Example 2 from Robby

Percentage Accurate: 99.8% → 99.8%
Time: 14.0s
Alternatives: 17
Speedup: 1.0×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 17 alternatives:

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

Initial Program: 99.8% accurate, 1.0× speedup?

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

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

Alternative 1: 99.8% accurate, 1.0× speedup?

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

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

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

Alternative 2: 51.1% accurate, 0.7× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;\cos t \cdot ew\\


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

    1. Initial program 99.9%

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

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

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

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

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

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

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

      if 2e-191 < (-.f64 (*.f64 (*.f64 ew (cos.f64 t)) (cos.f64 (atan.f64 (/.f64 (*.f64 (neg.f64 eh) (tan.f64 t)) ew)))) (*.f64 (*.f64 eh (sin.f64 t)) (sin.f64 (atan.f64 (/.f64 (*.f64 (neg.f64 eh) (tan.f64 t)) ew)))))

      1. Initial program 99.8%

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

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

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

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

          \[\leadsto \color{blue}{\left(\frac{-1}{2} \cdot ew - \left(-1 \cdot \frac{{eh}^{2}}{ew} + \frac{1}{2} \cdot \frac{{eh}^{2}}{ew}\right)\right) \cdot {t}^{2}} + ew \]
        3. lower-fma.f64N/A

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

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

          \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{-1}{2} \cdot ew} - \left(-1 \cdot \frac{{eh}^{2}}{ew} + \frac{1}{2} \cdot \frac{{eh}^{2}}{ew}\right), {t}^{2}, ew\right) \]
        6. distribute-rgt-outN/A

          \[\leadsto \mathsf{fma}\left(\frac{-1}{2} \cdot ew - \color{blue}{\frac{{eh}^{2}}{ew} \cdot \left(-1 + \frac{1}{2}\right)}, {t}^{2}, ew\right) \]
        7. metadata-evalN/A

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

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

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

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

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

          \[\leadsto \mathsf{fma}\left(\frac{-1}{2} \cdot ew - \frac{eh \cdot eh}{ew} \cdot \frac{-1}{2}, \color{blue}{t \cdot t}, ew\right) \]
        13. lower-*.f6435.1

          \[\leadsto \mathsf{fma}\left(-0.5 \cdot ew - \frac{eh \cdot eh}{ew} \cdot -0.5, \color{blue}{t \cdot t}, ew\right) \]
      6. Applied rewrites35.1%

        \[\leadsto \color{blue}{\mathsf{fma}\left(-0.5 \cdot ew - \frac{eh \cdot eh}{ew} \cdot -0.5, t \cdot t, ew\right)} \]
      7. Taylor expanded in eh around 0

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

          \[\leadsto \color{blue}{\cos t \cdot ew} \]
        2. lower-*.f64N/A

          \[\leadsto \color{blue}{\cos t \cdot ew} \]
        3. lower-cos.f6460.6

          \[\leadsto \color{blue}{\cos t} \cdot ew \]
      9. Applied rewrites60.6%

        \[\leadsto \color{blue}{\cos t \cdot ew} \]
    8. Recombined 2 regimes into one program.
    9. Final simplification53.3%

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

    Alternative 3: 51.4% accurate, 0.7× speedup?

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

      1. Initial program 99.9%

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

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

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

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

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

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

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

        if -1.0000000000000001e-290 < (-.f64 (*.f64 (*.f64 ew (cos.f64 t)) (cos.f64 (atan.f64 (/.f64 (*.f64 (neg.f64 eh) (tan.f64 t)) ew)))) (*.f64 (*.f64 eh (sin.f64 t)) (sin.f64 (atan.f64 (/.f64 (*.f64 (neg.f64 eh) (tan.f64 t)) ew)))))

        1. Initial program 99.8%

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

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

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

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

            \[\leadsto \color{blue}{\left(\frac{-1}{2} \cdot ew - \left(-1 \cdot \frac{{eh}^{2}}{ew} + \frac{1}{2} \cdot \frac{{eh}^{2}}{ew}\right)\right) \cdot {t}^{2}} + ew \]
          3. lower-fma.f64N/A

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

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

            \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{-1}{2} \cdot ew} - \left(-1 \cdot \frac{{eh}^{2}}{ew} + \frac{1}{2} \cdot \frac{{eh}^{2}}{ew}\right), {t}^{2}, ew\right) \]
          6. distribute-rgt-outN/A

            \[\leadsto \mathsf{fma}\left(\frac{-1}{2} \cdot ew - \color{blue}{\frac{{eh}^{2}}{ew} \cdot \left(-1 + \frac{1}{2}\right)}, {t}^{2}, ew\right) \]
          7. metadata-evalN/A

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

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

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

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

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

            \[\leadsto \mathsf{fma}\left(\frac{-1}{2} \cdot ew - \frac{eh \cdot eh}{ew} \cdot \frac{-1}{2}, \color{blue}{t \cdot t}, ew\right) \]
          13. lower-*.f6436.3

            \[\leadsto \mathsf{fma}\left(-0.5 \cdot ew - \frac{eh \cdot eh}{ew} \cdot -0.5, \color{blue}{t \cdot t}, ew\right) \]
        6. Applied rewrites36.3%

          \[\leadsto \color{blue}{\mathsf{fma}\left(-0.5 \cdot ew - \frac{eh \cdot eh}{ew} \cdot -0.5, t \cdot t, ew\right)} \]
        7. Taylor expanded in eh around 0

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

            \[\leadsto \color{blue}{\cos t \cdot ew} \]
          2. lower-*.f64N/A

            \[\leadsto \color{blue}{\cos t \cdot ew} \]
          3. lower-cos.f6461.1

            \[\leadsto \color{blue}{\cos t} \cdot ew \]
        9. Applied rewrites61.1%

          \[\leadsto \color{blue}{\cos t \cdot ew} \]
      8. Recombined 2 regimes into one program.
      9. Final simplification53.2%

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

      Alternative 4: 51.4% accurate, 0.7× speedup?

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

        1. Initial program 99.9%

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

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

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

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

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

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

        if -1.0000000000000001e-290 < (-.f64 (*.f64 (*.f64 ew (cos.f64 t)) (cos.f64 (atan.f64 (/.f64 (*.f64 (neg.f64 eh) (tan.f64 t)) ew)))) (*.f64 (*.f64 eh (sin.f64 t)) (sin.f64 (atan.f64 (/.f64 (*.f64 (neg.f64 eh) (tan.f64 t)) ew)))))

        1. Initial program 99.8%

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

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

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

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

            \[\leadsto \color{blue}{\left(\frac{-1}{2} \cdot ew - \left(-1 \cdot \frac{{eh}^{2}}{ew} + \frac{1}{2} \cdot \frac{{eh}^{2}}{ew}\right)\right) \cdot {t}^{2}} + ew \]
          3. lower-fma.f64N/A

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

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

            \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{-1}{2} \cdot ew} - \left(-1 \cdot \frac{{eh}^{2}}{ew} + \frac{1}{2} \cdot \frac{{eh}^{2}}{ew}\right), {t}^{2}, ew\right) \]
          6. distribute-rgt-outN/A

            \[\leadsto \mathsf{fma}\left(\frac{-1}{2} \cdot ew - \color{blue}{\frac{{eh}^{2}}{ew} \cdot \left(-1 + \frac{1}{2}\right)}, {t}^{2}, ew\right) \]
          7. metadata-evalN/A

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

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

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

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

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

            \[\leadsto \mathsf{fma}\left(\frac{-1}{2} \cdot ew - \frac{eh \cdot eh}{ew} \cdot \frac{-1}{2}, \color{blue}{t \cdot t}, ew\right) \]
          13. lower-*.f6436.3

            \[\leadsto \mathsf{fma}\left(-0.5 \cdot ew - \frac{eh \cdot eh}{ew} \cdot -0.5, \color{blue}{t \cdot t}, ew\right) \]
        6. Applied rewrites36.3%

          \[\leadsto \color{blue}{\mathsf{fma}\left(-0.5 \cdot ew - \frac{eh \cdot eh}{ew} \cdot -0.5, t \cdot t, ew\right)} \]
        7. Taylor expanded in eh around 0

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

            \[\leadsto \color{blue}{\cos t \cdot ew} \]
          2. lower-*.f64N/A

            \[\leadsto \color{blue}{\cos t \cdot ew} \]
          3. lower-cos.f6461.1

            \[\leadsto \color{blue}{\cos t} \cdot ew \]
        9. Applied rewrites61.1%

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

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

      Alternative 5: 50.1% accurate, 0.8× speedup?

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

        1. Initial program 99.9%

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

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

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

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

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

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

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

          if -1.0000000000000001e-290 < (-.f64 (*.f64 (*.f64 ew (cos.f64 t)) (cos.f64 (atan.f64 (/.f64 (*.f64 (neg.f64 eh) (tan.f64 t)) ew)))) (*.f64 (*.f64 eh (sin.f64 t)) (sin.f64 (atan.f64 (/.f64 (*.f64 (neg.f64 eh) (tan.f64 t)) ew)))))

          1. Initial program 99.8%

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

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

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

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

              \[\leadsto \color{blue}{\left(\frac{-1}{2} \cdot ew - \left(-1 \cdot \frac{{eh}^{2}}{ew} + \frac{1}{2} \cdot \frac{{eh}^{2}}{ew}\right)\right) \cdot {t}^{2}} + ew \]
            3. lower-fma.f64N/A

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

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

              \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{-1}{2} \cdot ew} - \left(-1 \cdot \frac{{eh}^{2}}{ew} + \frac{1}{2} \cdot \frac{{eh}^{2}}{ew}\right), {t}^{2}, ew\right) \]
            6. distribute-rgt-outN/A

              \[\leadsto \mathsf{fma}\left(\frac{-1}{2} \cdot ew - \color{blue}{\frac{{eh}^{2}}{ew} \cdot \left(-1 + \frac{1}{2}\right)}, {t}^{2}, ew\right) \]
            7. metadata-evalN/A

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

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

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

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

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

              \[\leadsto \mathsf{fma}\left(\frac{-1}{2} \cdot ew - \frac{eh \cdot eh}{ew} \cdot \frac{-1}{2}, \color{blue}{t \cdot t}, ew\right) \]
            13. lower-*.f6436.3

              \[\leadsto \mathsf{fma}\left(-0.5 \cdot ew - \frac{eh \cdot eh}{ew} \cdot -0.5, \color{blue}{t \cdot t}, ew\right) \]
          6. Applied rewrites36.3%

            \[\leadsto \color{blue}{\mathsf{fma}\left(-0.5 \cdot ew - \frac{eh \cdot eh}{ew} \cdot -0.5, t \cdot t, ew\right)} \]
          7. Taylor expanded in eh around 0

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

              \[\leadsto \color{blue}{\cos t \cdot ew} \]
            2. lower-*.f64N/A

              \[\leadsto \color{blue}{\cos t \cdot ew} \]
            3. lower-cos.f6461.1

              \[\leadsto \color{blue}{\cos t} \cdot ew \]
          9. Applied rewrites61.1%

            \[\leadsto \color{blue}{\cos t \cdot ew} \]
        8. Recombined 2 regimes into one program.
        9. Final simplification52.0%

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

        Alternative 6: 99.1% accurate, 1.1× speedup?

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

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

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

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

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

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

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

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

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

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

        Alternative 7: 96.0% accurate, 1.3× speedup?

        \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;eh \leq -7.5 \cdot 10^{+157} \lor \neg \left(eh \leq 1.3 \cdot 10^{+80}\right):\\ \;\;\;\;\left|\left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-t\right) \cdot eh}{ew}\right) - \left(ew \cdot 1\right) \cdot \cos \tan^{-1} \left(\frac{eh \cdot \tan t}{-ew}\right)\right|\\ \mathbf{else}:\\ \;\;\;\;\left|\mathsf{fma}\left(\frac{-\sin t}{ew}, eh \cdot \tanh \left(\frac{\left(-eh\right) \cdot t}{ew}\right), \cos \tan^{-1} \left(\frac{\tan t}{ew} \cdot eh\right) \cdot \cos t\right) \cdot ew\right|\\ \end{array} \end{array} \]
        (FPCore (eh ew t)
         :precision binary64
         (if (or (<= eh -7.5e+157) (not (<= eh 1.3e+80)))
           (fabs
            (-
             (* (* eh (sin t)) (sin (atan (/ (* (- t) eh) ew))))
             (* (* ew 1.0) (cos (atan (/ (* eh (tan t)) (- ew)))))))
           (fabs
            (*
             (fma
              (/ (- (sin t)) ew)
              (* eh (tanh (/ (* (- eh) t) ew)))
              (* (cos (atan (* (/ (tan t) ew) eh))) (cos t)))
             ew))))
        double code(double eh, double ew, double t) {
        	double tmp;
        	if ((eh <= -7.5e+157) || !(eh <= 1.3e+80)) {
        		tmp = fabs((((eh * sin(t)) * sin(atan(((-t * eh) / ew)))) - ((ew * 1.0) * cos(atan(((eh * tan(t)) / -ew))))));
        	} else {
        		tmp = fabs((fma((-sin(t) / ew), (eh * tanh(((-eh * t) / ew))), (cos(atan(((tan(t) / ew) * eh))) * cos(t))) * ew));
        	}
        	return tmp;
        }
        
        function code(eh, ew, t)
        	tmp = 0.0
        	if ((eh <= -7.5e+157) || !(eh <= 1.3e+80))
        		tmp = abs(Float64(Float64(Float64(eh * sin(t)) * sin(atan(Float64(Float64(Float64(-t) * eh) / ew)))) - Float64(Float64(ew * 1.0) * cos(atan(Float64(Float64(eh * tan(t)) / Float64(-ew)))))));
        	else
        		tmp = abs(Float64(fma(Float64(Float64(-sin(t)) / ew), Float64(eh * tanh(Float64(Float64(Float64(-eh) * t) / ew))), Float64(cos(atan(Float64(Float64(tan(t) / ew) * eh))) * cos(t))) * ew));
        	end
        	return tmp
        end
        
        code[eh_, ew_, t_] := If[Or[LessEqual[eh, -7.5e+157], N[Not[LessEqual[eh, 1.3e+80]], $MachinePrecision]], N[Abs[N[(N[(N[(eh * N[Sin[t], $MachinePrecision]), $MachinePrecision] * N[Sin[N[ArcTan[N[(N[((-t) * eh), $MachinePrecision] / ew), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - N[(N[(ew * 1.0), $MachinePrecision] * N[Cos[N[ArcTan[N[(N[(eh * N[Tan[t], $MachinePrecision]), $MachinePrecision] / (-ew)), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Abs[N[(N[(N[((-N[Sin[t], $MachinePrecision]) / ew), $MachinePrecision] * N[(eh * N[Tanh[N[(N[((-eh) * t), $MachinePrecision] / ew), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + N[(N[Cos[N[ArcTan[N[(N[(N[Tan[t], $MachinePrecision] / ew), $MachinePrecision] * eh), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * N[Cos[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * ew), $MachinePrecision]], $MachinePrecision]]
        
        \begin{array}{l}
        
        \\
        \begin{array}{l}
        \mathbf{if}\;eh \leq -7.5 \cdot 10^{+157} \lor \neg \left(eh \leq 1.3 \cdot 10^{+80}\right):\\
        \;\;\;\;\left|\left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-t\right) \cdot eh}{ew}\right) - \left(ew \cdot 1\right) \cdot \cos \tan^{-1} \left(\frac{eh \cdot \tan t}{-ew}\right)\right|\\
        
        \mathbf{else}:\\
        \;\;\;\;\left|\mathsf{fma}\left(\frac{-\sin t}{ew}, eh \cdot \tanh \left(\frac{\left(-eh\right) \cdot t}{ew}\right), \cos \tan^{-1} \left(\frac{\tan t}{ew} \cdot eh\right) \cdot \cos t\right) \cdot ew\right|\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 2 regimes
        2. if eh < -7.5e157 or 1.29999999999999991e80 < eh

          1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

            if -7.5e157 < eh < 1.29999999999999991e80

            1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

                \[\leadsto \begin{array}{l} \mathbf{if}\;eh \leq -7.5 \cdot 10^{+157} \lor \neg \left(eh \leq 1.3 \cdot 10^{+80}\right):\\ \;\;\;\;\left|\left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-t\right) \cdot eh}{ew}\right) - \left(ew \cdot 1\right) \cdot \cos \tan^{-1} \left(\frac{eh \cdot \tan t}{-ew}\right)\right|\\ \mathbf{else}:\\ \;\;\;\;\left|\mathsf{fma}\left(\frac{-\sin t}{ew}, eh \cdot \tanh \left(\frac{\left(-eh\right) \cdot t}{ew}\right), \cos \tan^{-1} \left(\frac{\tan t}{ew} \cdot eh\right) \cdot \cos t\right) \cdot ew\right|\\ \end{array} \]
              7. Add Preprocessing

              Alternative 8: 77.1% accurate, 1.3× speedup?

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

                1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                  if -2.79999999999999988e-74 < ew < 1.8500000000000001e-244

                  1. Initial program 99.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                    if 1.8500000000000001e-244 < ew < 1.70000000000000013e61

                    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

                    \[\leadsto \begin{array}{l} \mathbf{if}\;ew \leq -2.8 \cdot 10^{-74}:\\ \;\;\;\;\left|\left(\cos t \cdot ew\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \sin t}{\cos t \cdot ew}\right)\right|\\ \mathbf{elif}\;ew \leq 1.85 \cdot 10^{-244}:\\ \;\;\;\;\left|\left(\tanh \sinh^{-1} \left(\frac{\tan t}{ew} \cdot \left(-eh\right)\right) \cdot \left(-\sin t\right)\right) \cdot eh\right|\\ \mathbf{elif}\;ew \leq 1.7 \cdot 10^{+61}:\\ \;\;\;\;\mathsf{fma}\left(\left(-\sin t\right) \cdot eh, \tanh \sinh^{-1} \left(\frac{\left(-t\right) \cdot eh}{ew}\right), \left(\cos t \cdot ew\right) \cdot \cos \tan^{-1} \left(\frac{eh \cdot t}{ew}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left|\left(\cos t \cdot ew\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \sin t}{\cos t \cdot ew}\right)\right|\\ \end{array} \]
                  9. Add Preprocessing

                  Alternative 9: 87.7% accurate, 1.3× speedup?

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

                    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                      if -1.20000000000000009e108 < ew < 5.29999999999999978e79

                      1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

                      Alternative 10: 76.6% accurate, 1.5× speedup?

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

                        1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                          if -2.79999999999999988e-74 < ew < 1.8500000000000001e-244

                          1. Initial program 99.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                            if 1.8500000000000001e-244 < ew < 5.29999999999999978e79

                            1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                              \[\leadsto \begin{array}{l} \mathbf{if}\;ew \leq -2.8 \cdot 10^{-74}:\\ \;\;\;\;\left|\left(\cos t \cdot ew\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \sin t}{\cos t \cdot ew}\right)\right|\\ \mathbf{elif}\;ew \leq 1.85 \cdot 10^{-244}:\\ \;\;\;\;\left|\left(\tanh \sinh^{-1} \left(\frac{\tan t}{ew} \cdot \left(-eh\right)\right) \cdot \left(-\sin t\right)\right) \cdot eh\right|\\ \mathbf{elif}\;ew \leq 5.3 \cdot 10^{+79}:\\ \;\;\;\;\mathsf{fma}\left(\left(-\sin t\right) \cdot eh, \tanh \sinh^{-1} \left(\frac{\left(-t\right) \cdot eh}{ew}\right), \left(1 \cdot ew\right) \cdot \cos \tan^{-1} \left(\frac{eh \cdot t}{ew}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left|\left(\cos t \cdot ew\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \sin t}{\cos t \cdot ew}\right)\right|\\ \end{array} \]
                            14. Add Preprocessing

                            Alternative 11: 75.4% accurate, 1.6× speedup?

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

                              1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                              if -5.20000000000000021e85 < eh < 2.35000000000000011e79

                              1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                \[\leadsto \begin{array}{l} \mathbf{if}\;eh \leq -5.2 \cdot 10^{+85} \lor \neg \left(eh \leq 2.35 \cdot 10^{+79}\right):\\ \;\;\;\;\left|\left(\left(-\sin t\right) \cdot eh\right) \cdot \sin \tan^{-1} \left(\frac{-\sin t}{ew} \cdot \frac{eh}{\cos t}\right)\right|\\ \mathbf{else}:\\ \;\;\;\;\left|\left(\cos t \cdot ew\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \sin t}{\cos t \cdot ew}\right)\right|\\ \end{array} \]
                              9. Add Preprocessing

                              Alternative 12: 75.4% accurate, 1.6× speedup?

                              \[\begin{array}{l} \\ \begin{array}{l} t_1 := \cos t \cdot ew\\ \mathbf{if}\;eh \leq -5.2 \cdot 10^{+85} \lor \neg \left(eh \leq 2.35 \cdot 10^{+79}\right):\\ \;\;\;\;\left|\left(\tanh \sinh^{-1} \left(\frac{\tan t}{ew} \cdot \left(-eh\right)\right) \cdot \left(-\sin t\right)\right) \cdot eh\right|\\ \mathbf{else}:\\ \;\;\;\;\left|t\_1 \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \sin t}{t\_1}\right)\right|\\ \end{array} \end{array} \]
                              (FPCore (eh ew t)
                               :precision binary64
                               (let* ((t_1 (* (cos t) ew)))
                                 (if (or (<= eh -5.2e+85) (not (<= eh 2.35e+79)))
                                   (fabs (* (* (tanh (asinh (* (/ (tan t) ew) (- eh)))) (- (sin t))) eh))
                                   (fabs (* t_1 (cos (atan (/ (* (- eh) (sin t)) t_1))))))))
                              double code(double eh, double ew, double t) {
                              	double t_1 = cos(t) * ew;
                              	double tmp;
                              	if ((eh <= -5.2e+85) || !(eh <= 2.35e+79)) {
                              		tmp = fabs(((tanh(asinh(((tan(t) / ew) * -eh))) * -sin(t)) * eh));
                              	} else {
                              		tmp = fabs((t_1 * cos(atan(((-eh * sin(t)) / t_1)))));
                              	}
                              	return tmp;
                              }
                              
                              def code(eh, ew, t):
                              	t_1 = math.cos(t) * ew
                              	tmp = 0
                              	if (eh <= -5.2e+85) or not (eh <= 2.35e+79):
                              		tmp = math.fabs(((math.tanh(math.asinh(((math.tan(t) / ew) * -eh))) * -math.sin(t)) * eh))
                              	else:
                              		tmp = math.fabs((t_1 * math.cos(math.atan(((-eh * math.sin(t)) / t_1)))))
                              	return tmp
                              
                              function code(eh, ew, t)
                              	t_1 = Float64(cos(t) * ew)
                              	tmp = 0.0
                              	if ((eh <= -5.2e+85) || !(eh <= 2.35e+79))
                              		tmp = abs(Float64(Float64(tanh(asinh(Float64(Float64(tan(t) / ew) * Float64(-eh)))) * Float64(-sin(t))) * eh));
                              	else
                              		tmp = abs(Float64(t_1 * cos(atan(Float64(Float64(Float64(-eh) * sin(t)) / t_1)))));
                              	end
                              	return tmp
                              end
                              
                              function tmp_2 = code(eh, ew, t)
                              	t_1 = cos(t) * ew;
                              	tmp = 0.0;
                              	if ((eh <= -5.2e+85) || ~((eh <= 2.35e+79)))
                              		tmp = abs(((tanh(asinh(((tan(t) / ew) * -eh))) * -sin(t)) * eh));
                              	else
                              		tmp = abs((t_1 * cos(atan(((-eh * sin(t)) / t_1)))));
                              	end
                              	tmp_2 = tmp;
                              end
                              
                              code[eh_, ew_, t_] := Block[{t$95$1 = N[(N[Cos[t], $MachinePrecision] * ew), $MachinePrecision]}, If[Or[LessEqual[eh, -5.2e+85], N[Not[LessEqual[eh, 2.35e+79]], $MachinePrecision]], N[Abs[N[(N[(N[Tanh[N[ArcSinh[N[(N[(N[Tan[t], $MachinePrecision] / ew), $MachinePrecision] * (-eh)), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * (-N[Sin[t], $MachinePrecision])), $MachinePrecision] * eh), $MachinePrecision]], $MachinePrecision], N[Abs[N[(t$95$1 * N[Cos[N[ArcTan[N[(N[((-eh) * N[Sin[t], $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]
                              
                              \begin{array}{l}
                              
                              \\
                              \begin{array}{l}
                              t_1 := \cos t \cdot ew\\
                              \mathbf{if}\;eh \leq -5.2 \cdot 10^{+85} \lor \neg \left(eh \leq 2.35 \cdot 10^{+79}\right):\\
                              \;\;\;\;\left|\left(\tanh \sinh^{-1} \left(\frac{\tan t}{ew} \cdot \left(-eh\right)\right) \cdot \left(-\sin t\right)\right) \cdot eh\right|\\
                              
                              \mathbf{else}:\\
                              \;\;\;\;\left|t\_1 \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \sin t}{t\_1}\right)\right|\\
                              
                              
                              \end{array}
                              \end{array}
                              
                              Derivation
                              1. Split input into 2 regimes
                              2. if eh < -5.20000000000000021e85 or 2.35000000000000011e79 < eh

                                1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                  if -5.20000000000000021e85 < eh < 2.35000000000000011e79

                                  1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                    \[\leadsto \begin{array}{l} \mathbf{if}\;eh \leq -5.2 \cdot 10^{+85} \lor \neg \left(eh \leq 2.35 \cdot 10^{+79}\right):\\ \;\;\;\;\left|\left(\tanh \sinh^{-1} \left(\frac{\tan t}{ew} \cdot \left(-eh\right)\right) \cdot \left(-\sin t\right)\right) \cdot eh\right|\\ \mathbf{else}:\\ \;\;\;\;\left|\left(\cos t \cdot ew\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \sin t}{\cos t \cdot ew}\right)\right|\\ \end{array} \]
                                  9. Add Preprocessing

                                  Alternative 13: 61.1% accurate, 1.9× speedup?

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

                                    1. Initial program 99.9%

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

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

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

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

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

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

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

                                      if -1.50000000000000014e-39 < ew < 1e80

                                      1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                        if 1e80 < ew

                                        1. Initial program 99.9%

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

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

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

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

                                            \[\leadsto \color{blue}{\left(\frac{-1}{2} \cdot ew - \left(-1 \cdot \frac{{eh}^{2}}{ew} + \frac{1}{2} \cdot \frac{{eh}^{2}}{ew}\right)\right) \cdot {t}^{2}} + ew \]
                                          3. lower-fma.f64N/A

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

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

                                            \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{-1}{2} \cdot ew} - \left(-1 \cdot \frac{{eh}^{2}}{ew} + \frac{1}{2} \cdot \frac{{eh}^{2}}{ew}\right), {t}^{2}, ew\right) \]
                                          6. distribute-rgt-outN/A

                                            \[\leadsto \mathsf{fma}\left(\frac{-1}{2} \cdot ew - \color{blue}{\frac{{eh}^{2}}{ew} \cdot \left(-1 + \frac{1}{2}\right)}, {t}^{2}, ew\right) \]
                                          7. metadata-evalN/A

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

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

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

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

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

                                            \[\leadsto \mathsf{fma}\left(\frac{-1}{2} \cdot ew - \frac{eh \cdot eh}{ew} \cdot \frac{-1}{2}, \color{blue}{t \cdot t}, ew\right) \]
                                          13. lower-*.f6443.7

                                            \[\leadsto \mathsf{fma}\left(-0.5 \cdot ew - \frac{eh \cdot eh}{ew} \cdot -0.5, \color{blue}{t \cdot t}, ew\right) \]
                                        6. Applied rewrites43.7%

                                          \[\leadsto \color{blue}{\mathsf{fma}\left(-0.5 \cdot ew - \frac{eh \cdot eh}{ew} \cdot -0.5, t \cdot t, ew\right)} \]
                                        7. Taylor expanded in eh around 0

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

                                            \[\leadsto \color{blue}{\cos t \cdot ew} \]
                                          2. lower-*.f64N/A

                                            \[\leadsto \color{blue}{\cos t \cdot ew} \]
                                          3. lower-cos.f6475.3

                                            \[\leadsto \color{blue}{\cos t} \cdot ew \]
                                        9. Applied rewrites75.3%

                                          \[\leadsto \color{blue}{\cos t \cdot ew} \]
                                      7. Recombined 3 regimes into one program.
                                      8. Final simplification65.1%

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

                                      Alternative 14: 61.9% accurate, 2.3× speedup?

                                      \[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{\mathsf{PI}\left(\right)}{2}\\ \mathbf{if}\;t \leq -0.0285 \lor \neg \left(t \leq 6 \cdot 10^{-21}\right):\\ \;\;\;\;\left|\left(\left(-\sin t\right) \cdot eh\right) \cdot \sin \tan^{-1} \left(\mathsf{fma}\left(-0.3333333333333333 \cdot \frac{eh}{ew}, t \cdot t, \frac{-eh}{ew}\right) \cdot t\right)\right|\\ \mathbf{else}:\\ \;\;\;\;\left|\cos \tan^{-1} \left(\frac{\sin \left(\left(t\_1 + t\right) - t\_1\right)}{ew} \cdot \left(-\mathsf{fma}\left(\left(t \cdot t\right) \cdot eh, 0.5, eh\right)\right)\right) \cdot ew\right|\\ \end{array} \end{array} \]
                                      (FPCore (eh ew t)
                                       :precision binary64
                                       (let* ((t_1 (/ (PI) 2.0)))
                                         (if (or (<= t -0.0285) (not (<= t 6e-21)))
                                           (fabs
                                            (*
                                             (* (- (sin t)) eh)
                                             (sin
                                              (atan
                                               (*
                                                (fma (* -0.3333333333333333 (/ eh ew)) (* t t) (/ (- eh) ew))
                                                t)))))
                                           (fabs
                                            (*
                                             (cos
                                              (atan
                                               (* (/ (sin (- (+ t_1 t) t_1)) ew) (- (fma (* (* t t) eh) 0.5 eh)))))
                                             ew)))))
                                      \begin{array}{l}
                                      
                                      \\
                                      \begin{array}{l}
                                      t_1 := \frac{\mathsf{PI}\left(\right)}{2}\\
                                      \mathbf{if}\;t \leq -0.0285 \lor \neg \left(t \leq 6 \cdot 10^{-21}\right):\\
                                      \;\;\;\;\left|\left(\left(-\sin t\right) \cdot eh\right) \cdot \sin \tan^{-1} \left(\mathsf{fma}\left(-0.3333333333333333 \cdot \frac{eh}{ew}, t \cdot t, \frac{-eh}{ew}\right) \cdot t\right)\right|\\
                                      
                                      \mathbf{else}:\\
                                      \;\;\;\;\left|\cos \tan^{-1} \left(\frac{\sin \left(\left(t\_1 + t\right) - t\_1\right)}{ew} \cdot \left(-\mathsf{fma}\left(\left(t \cdot t\right) \cdot eh, 0.5, eh\right)\right)\right) \cdot ew\right|\\
                                      
                                      
                                      \end{array}
                                      \end{array}
                                      
                                      Derivation
                                      1. Split input into 2 regimes
                                      2. if t < -0.028500000000000001 or 5.99999999999999982e-21 < t

                                        1. Initial program 99.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                          if -0.028500000000000001 < t < 5.99999999999999982e-21

                                          1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

                                              Alternative 15: 61.8% accurate, 2.3× speedup?

                                              \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t \leq -0.0285 \lor \neg \left(t \leq 6 \cdot 10^{-21}\right):\\ \;\;\;\;\left|\left(\left(-\sin t\right) \cdot eh\right) \cdot \sin \tan^{-1} \left(\mathsf{fma}\left(-0.3333333333333333 \cdot \frac{eh}{ew}, t \cdot t, \frac{-eh}{ew}\right) \cdot t\right)\right|\\ \mathbf{else}:\\ \;\;\;\;\left|\cos \tan^{-1} \left(\frac{\tan t}{ew} \cdot eh\right) \cdot ew\right|\\ \end{array} \end{array} \]
                                              (FPCore (eh ew t)
                                               :precision binary64
                                               (if (or (<= t -0.0285) (not (<= t 6e-21)))
                                                 (fabs
                                                  (*
                                                   (* (- (sin t)) eh)
                                                   (sin
                                                    (atan
                                                     (* (fma (* -0.3333333333333333 (/ eh ew)) (* t t) (/ (- eh) ew)) t)))))
                                                 (fabs (* (cos (atan (* (/ (tan t) ew) eh))) ew))))
                                              double code(double eh, double ew, double t) {
                                              	double tmp;
                                              	if ((t <= -0.0285) || !(t <= 6e-21)) {
                                              		tmp = fabs(((-sin(t) * eh) * sin(atan((fma((-0.3333333333333333 * (eh / ew)), (t * t), (-eh / ew)) * t)))));
                                              	} else {
                                              		tmp = fabs((cos(atan(((tan(t) / ew) * eh))) * ew));
                                              	}
                                              	return tmp;
                                              }
                                              
                                              function code(eh, ew, t)
                                              	tmp = 0.0
                                              	if ((t <= -0.0285) || !(t <= 6e-21))
                                              		tmp = abs(Float64(Float64(Float64(-sin(t)) * eh) * sin(atan(Float64(fma(Float64(-0.3333333333333333 * Float64(eh / ew)), Float64(t * t), Float64(Float64(-eh) / ew)) * t)))));
                                              	else
                                              		tmp = abs(Float64(cos(atan(Float64(Float64(tan(t) / ew) * eh))) * ew));
                                              	end
                                              	return tmp
                                              end
                                              
                                              code[eh_, ew_, t_] := If[Or[LessEqual[t, -0.0285], N[Not[LessEqual[t, 6e-21]], $MachinePrecision]], N[Abs[N[(N[((-N[Sin[t], $MachinePrecision]) * eh), $MachinePrecision] * N[Sin[N[ArcTan[N[(N[(N[(-0.3333333333333333 * N[(eh / ew), $MachinePrecision]), $MachinePrecision] * N[(t * t), $MachinePrecision] + N[((-eh) / ew), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Abs[N[(N[Cos[N[ArcTan[N[(N[(N[Tan[t], $MachinePrecision] / ew), $MachinePrecision] * eh), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * ew), $MachinePrecision]], $MachinePrecision]]
                                              
                                              \begin{array}{l}
                                              
                                              \\
                                              \begin{array}{l}
                                              \mathbf{if}\;t \leq -0.0285 \lor \neg \left(t \leq 6 \cdot 10^{-21}\right):\\
                                              \;\;\;\;\left|\left(\left(-\sin t\right) \cdot eh\right) \cdot \sin \tan^{-1} \left(\mathsf{fma}\left(-0.3333333333333333 \cdot \frac{eh}{ew}, t \cdot t, \frac{-eh}{ew}\right) \cdot t\right)\right|\\
                                              
                                              \mathbf{else}:\\
                                              \;\;\;\;\left|\cos \tan^{-1} \left(\frac{\tan t}{ew} \cdot eh\right) \cdot ew\right|\\
                                              
                                              
                                              \end{array}
                                              \end{array}
                                              
                                              Derivation
                                              1. Split input into 2 regimes
                                              2. if t < -0.028500000000000001 or 5.99999999999999982e-21 < t

                                                1. Initial program 99.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                  if -0.028500000000000001 < t < 5.99999999999999982e-21

                                                  1. Initial program 100.0%

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

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

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

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

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

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

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

                                                Alternative 16: 31.6% accurate, 8.1× speedup?

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

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

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

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

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

                                                    \[\leadsto \color{blue}{\left(\frac{-1}{2} \cdot ew - \left(-1 \cdot \frac{{eh}^{2}}{ew} + \frac{1}{2} \cdot \frac{{eh}^{2}}{ew}\right)\right) \cdot {t}^{2}} + ew \]
                                                  3. lower-fma.f64N/A

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

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

                                                    \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{-1}{2} \cdot ew} - \left(-1 \cdot \frac{{eh}^{2}}{ew} + \frac{1}{2} \cdot \frac{{eh}^{2}}{ew}\right), {t}^{2}, ew\right) \]
                                                  6. distribute-rgt-outN/A

                                                    \[\leadsto \mathsf{fma}\left(\frac{-1}{2} \cdot ew - \color{blue}{\frac{{eh}^{2}}{ew} \cdot \left(-1 + \frac{1}{2}\right)}, {t}^{2}, ew\right) \]
                                                  7. metadata-evalN/A

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

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

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

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

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

                                                    \[\leadsto \mathsf{fma}\left(\frac{-1}{2} \cdot ew - \frac{eh \cdot eh}{ew} \cdot \frac{-1}{2}, \color{blue}{t \cdot t}, ew\right) \]
                                                  13. lower-*.f6419.6

                                                    \[\leadsto \mathsf{fma}\left(-0.5 \cdot ew - \frac{eh \cdot eh}{ew} \cdot -0.5, \color{blue}{t \cdot t}, ew\right) \]
                                                6. Applied rewrites19.6%

                                                  \[\leadsto \color{blue}{\mathsf{fma}\left(-0.5 \cdot ew - \frac{eh \cdot eh}{ew} \cdot -0.5, t \cdot t, ew\right)} \]
                                                7. Taylor expanded in eh around 0

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

                                                    \[\leadsto \color{blue}{\cos t \cdot ew} \]
                                                  2. lower-*.f64N/A

                                                    \[\leadsto \color{blue}{\cos t \cdot ew} \]
                                                  3. lower-cos.f6432.0

                                                    \[\leadsto \color{blue}{\cos t} \cdot ew \]
                                                9. Applied rewrites32.0%

                                                  \[\leadsto \color{blue}{\cos t \cdot ew} \]
                                                10. Add Preprocessing

                                                Alternative 17: 22.2% accurate, 143.7× speedup?

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

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

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

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

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

                                                    \[\leadsto \color{blue}{\left(\frac{-1}{2} \cdot ew - \left(-1 \cdot \frac{{eh}^{2}}{ew} + \frac{1}{2} \cdot \frac{{eh}^{2}}{ew}\right)\right) \cdot {t}^{2}} + ew \]
                                                  3. lower-fma.f64N/A

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

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

                                                    \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{-1}{2} \cdot ew} - \left(-1 \cdot \frac{{eh}^{2}}{ew} + \frac{1}{2} \cdot \frac{{eh}^{2}}{ew}\right), {t}^{2}, ew\right) \]
                                                  6. distribute-rgt-outN/A

                                                    \[\leadsto \mathsf{fma}\left(\frac{-1}{2} \cdot ew - \color{blue}{\frac{{eh}^{2}}{ew} \cdot \left(-1 + \frac{1}{2}\right)}, {t}^{2}, ew\right) \]
                                                  7. metadata-evalN/A

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

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

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

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

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

                                                    \[\leadsto \mathsf{fma}\left(\frac{-1}{2} \cdot ew - \frac{eh \cdot eh}{ew} \cdot \frac{-1}{2}, \color{blue}{t \cdot t}, ew\right) \]
                                                  13. lower-*.f6419.6

                                                    \[\leadsto \mathsf{fma}\left(-0.5 \cdot ew - \frac{eh \cdot eh}{ew} \cdot -0.5, \color{blue}{t \cdot t}, ew\right) \]
                                                6. Applied rewrites19.6%

                                                  \[\leadsto \color{blue}{\mathsf{fma}\left(-0.5 \cdot ew - \frac{eh \cdot eh}{ew} \cdot -0.5, t \cdot t, ew\right)} \]
                                                7. Taylor expanded in eh around 0

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

                                                    \[\leadsto \color{blue}{\cos t \cdot ew} \]
                                                  2. lower-*.f64N/A

                                                    \[\leadsto \color{blue}{\cos t \cdot ew} \]
                                                  3. lower-cos.f6432.0

                                                    \[\leadsto \color{blue}{\cos t} \cdot ew \]
                                                9. Applied rewrites32.0%

                                                  \[\leadsto \color{blue}{\cos t \cdot ew} \]
                                                10. Taylor expanded in t around 0

                                                  \[\leadsto 1 \cdot ew \]
                                                11. Step-by-step derivation
                                                  1. Applied rewrites25.0%

                                                    \[\leadsto 1 \cdot ew \]
                                                  2. Add Preprocessing

                                                  Reproduce

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