Example 2 from Robby

Percentage Accurate: 99.8% → 99.8%
Time: 18.7s
Alternatives: 11
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 11 alternatives:

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

Initial Program: 99.8% accurate, 1.0× speedup?

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

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

Alternative 1: 99.8% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \tan^{-1} \left(-\frac{eh \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{eh \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}
Derivation
  1. Initial program 99.8%

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

    \[\leadsto \left|\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)\right| \]
  4. Add Preprocessing

Alternative 2: 99.1% accurate, 1.1× speedup?

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

\\
\left|\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{t \cdot \left(-eh\right)}{ew}\right)\right|
\end{array}
Derivation
  1. Initial program 99.8%

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

    \[\leadsto \left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t}{ew}\right) - \left(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. associate-*r*N/A

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

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

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

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

      \[\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{t \cdot \color{blue}{\left(-eh\right)}}{ew}\right)\right| \]
  5. Simplified99.4%

    \[\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}{t \cdot \left(-eh\right)}}{ew}\right)\right| \]
  6. Final simplification99.4%

    \[\leadsto \left|\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{t \cdot \left(-eh\right)}{ew}\right)\right| \]
  7. Add Preprocessing

Alternative 3: 96.3% accurate, 1.2× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if eh < -4.80000000000000019e-134 or 1.99999999999999992e-164 < 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(\mathsf{neg}\left(eh\right)\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. associate-*r*N/A

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

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

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

        \[\leadsto \left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t}{ew}\right) - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{t \cdot \color{blue}{\left(\mathsf{neg}\left(eh\right)\right)}}{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{t \cdot \color{blue}{\left(-eh\right)}}{ew}\right)\right| \]
    5. Simplified99.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}{t \cdot \left(-eh\right)}}{ew}\right)\right| \]
    6. Taylor expanded in eh around -inf

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

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

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

    if -4.80000000000000019e-134 < eh < 1.99999999999999992e-164

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 95.6% accurate, 1.5× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if eh < -4.80000000000000019e-134 or 1.99999999999999992e-164 < 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(\mathsf{neg}\left(eh\right)\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. associate-*r*N/A

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

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

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

        \[\leadsto \left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t}{ew}\right) - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{t \cdot \color{blue}{\left(\mathsf{neg}\left(eh\right)\right)}}{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{t \cdot \color{blue}{\left(-eh\right)}}{ew}\right)\right| \]
    5. Simplified99.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}{t \cdot \left(-eh\right)}}{ew}\right)\right| \]
    6. Taylor expanded in eh around -inf

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

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

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

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

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

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

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

    if -4.80000000000000019e-134 < eh < 1.99999999999999992e-164

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 95.9% accurate, 1.5× speedup?

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

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

\mathbf{elif}\;eh \leq 3.8 \cdot 10^{-146}:\\
\;\;\;\;\left|\frac{\mathsf{fma}\left(\tan t \cdot \frac{eh}{ew}, eh \cdot \sin t, ew \cdot \cos t\right)}{\sqrt{{\left(\frac{eh \cdot \tan t}{ew}\right)}^{2} + 1}}\right|\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if eh < -4.80000000000000019e-134 or 3.79999999999999994e-146 < 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(\mathsf{neg}\left(eh\right)\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. associate-*r*N/A

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

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

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

        \[\leadsto \left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t}{ew}\right) - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{t \cdot \color{blue}{\left(\mathsf{neg}\left(eh\right)\right)}}{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{t \cdot \color{blue}{\left(-eh\right)}}{ew}\right)\right| \]
    5. Simplified99.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}{t \cdot \left(-eh\right)}}{ew}\right)\right| \]
    6. Taylor expanded in eh around -inf

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

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

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

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

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

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

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

    if -4.80000000000000019e-134 < eh < 3.79999999999999994e-146

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 90.1% accurate, 1.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;ew \leq 2.6 \cdot 10^{+132}:\\
\;\;\;\;\left|eh \cdot \mathsf{fma}\left(-ew, \frac{\cos t}{eh}, \sin \tan^{-1} \left(\frac{t \cdot \left(-eh\right)}{ew}\right) \cdot \sin t\right)\right|\\

\mathbf{else}:\\
\;\;\;\;\left|ew \cdot \cos t\right|\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if ew < 2.6e132

    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(\mathsf{neg}\left(eh\right)\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. associate-*r*N/A

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

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

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

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

        \[\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{t \cdot \color{blue}{\left(-eh\right)}}{ew}\right)\right| \]
    5. Simplified99.4%

      \[\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}{t \cdot \left(-eh\right)}}{ew}\right)\right| \]
    6. Taylor expanded in eh around -inf

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

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

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

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

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

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

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

    if 2.6e132 < 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 egg-rr99.8%

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

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

        \[\leadsto \left|\color{blue}{ew \cdot \cos t}\right| \]
      2. lower-cos.f6497.1

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

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

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

Alternative 7: 75.4% accurate, 7.2× speedup?

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

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

\mathbf{elif}\;ew \leq 2.9 \cdot 10^{-84}:\\
\;\;\;\;\left|eh \cdot \sin t\right|\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if ew < -1.7e-21 or 2.90000000000000019e-84 < 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 egg-rr93.1%

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

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

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

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

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

    if -1.7e-21 < ew < 2.90000000000000019e-84

    1. Initial program 99.8%

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

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

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

        \[\leadsto \left|\color{blue}{eh \cdot \sin t}\right| \]
      2. lower-sin.f6474.2

        \[\leadsto \left|eh \cdot \color{blue}{\sin t}\right| \]
    6. Simplified74.2%

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

Alternative 8: 61.5% accurate, 7.2× speedup?

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

\\
\begin{array}{l}
t_1 := \left|eh \cdot \sin t\right|\\
\mathbf{if}\;t \leq -1.8 \cdot 10^{-27}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;t \leq 2.25 \cdot 10^{-53}:\\
\;\;\;\;\left|\mathsf{fma}\left(eh \cdot 0.5, \frac{eh \cdot \left(t \cdot t\right)}{ew}, \mathsf{fma}\left(t, t \cdot \left(ew \cdot -0.5\right), ew\right)\right)\right|\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -1.7999999999999999e-27 or 2.24999999999999992e-53 < t

    1. Initial program 99.6%

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

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

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

        \[\leadsto \left|\color{blue}{eh \cdot \sin t}\right| \]
      2. lower-sin.f6456.0

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

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

    if -1.7999999999999999e-27 < t < 2.24999999999999992e-53

    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. Applied egg-rr88.4%

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

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

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

        \[\leadsto \left|{t}^{2} \cdot \color{blue}{\left(\frac{-1}{2} \cdot ew + \left(\frac{-1}{2} \cdot \frac{{eh}^{2}}{ew} - -1 \cdot \frac{{eh}^{2}}{ew}\right)\right)} + ew\right| \]
      3. cancel-sign-sub-invN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left|ew + \mathsf{fma}\left(\frac{1}{2}, \left(eh \cdot eh\right) \cdot \frac{t \cdot t}{ew}, \frac{-1}{2} \cdot \left(ew \cdot \color{blue}{\left(t \cdot t\right)}\right)\right)\right| \]
      15. lower-*.f6460.0

        \[\leadsto \left|ew + \mathsf{fma}\left(0.5, \left(eh \cdot eh\right) \cdot \frac{t \cdot t}{ew}, -0.5 \cdot \left(ew \cdot \color{blue}{\left(t \cdot t\right)}\right)\right)\right| \]
    9. Simplified60.0%

      \[\leadsto \color{blue}{\left|ew + \mathsf{fma}\left(0.5, \left(eh \cdot eh\right) \cdot \frac{t \cdot t}{ew}, -0.5 \cdot \left(ew \cdot \left(t \cdot t\right)\right)\right)\right|} \]
    10. Step-by-step derivation
      1. lift-*.f64N/A

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left|\color{blue}{\frac{1}{2} \cdot \left(\left(eh \cdot eh\right) \cdot \frac{t \cdot t}{ew}\right) + \left(\frac{-1}{2} \cdot \left(ew \cdot \left(t \cdot t\right)\right) + ew\right)}\right| \]
    11. Applied egg-rr71.8%

      \[\leadsto \left|\color{blue}{\mathsf{fma}\left(eh \cdot 0.5, \frac{eh \cdot \left(t \cdot t\right)}{ew}, \mathsf{fma}\left(t, t \cdot \left(ew \cdot -0.5\right), ew\right)\right)}\right| \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 9: 38.8% accurate, 45.4× speedup?

\[\begin{array}{l} \\ \left|\mathsf{fma}\left(t \cdot \left(ew \cdot t\right), -0.5, ew\right)\right| \end{array} \]
(FPCore (eh ew t) :precision binary64 (fabs (fma (* t (* ew t)) -0.5 ew)))
double code(double eh, double ew, double t) {
	return fabs(fma((t * (ew * t)), -0.5, ew));
}
function code(eh, ew, t)
	return abs(fma(Float64(t * Float64(ew * t)), -0.5, ew))
end
code[eh_, ew_, t_] := N[Abs[N[(N[(t * N[(ew * t), $MachinePrecision]), $MachinePrecision] * -0.5 + ew), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}

\\
\left|\mathsf{fma}\left(t \cdot \left(ew \cdot t\right), -0.5, ew\right)\right|
\end{array}
Derivation
  1. Initial program 99.8%

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

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

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

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

      \[\leadsto \left|{t}^{2} \cdot \color{blue}{\left(\frac{-1}{2} \cdot ew + \left(\frac{-1}{2} \cdot \frac{{eh}^{2}}{ew} - -1 \cdot \frac{{eh}^{2}}{ew}\right)\right)} + ew\right| \]
    3. cancel-sign-sub-invN/A

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

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

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

      \[\leadsto \left|\color{blue}{\mathsf{fma}\left({t}^{2}, \frac{-1}{2} \cdot ew + \left(\frac{-1}{2} \cdot \frac{{eh}^{2}}{ew} + \frac{{eh}^{2}}{ew}\right), ew\right)}\right| \]
  6. Simplified32.6%

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

    \[\leadsto \left|\mathsf{fma}\left(t \cdot t, \color{blue}{\frac{-1}{2} \cdot ew}, ew\right)\right| \]
  8. Step-by-step derivation
    1. *-commutativeN/A

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

      \[\leadsto \left|\mathsf{fma}\left(t \cdot t, \color{blue}{ew \cdot -0.5}, ew\right)\right| \]
  9. Simplified38.2%

    \[\leadsto \left|\mathsf{fma}\left(t \cdot t, \color{blue}{ew \cdot -0.5}, ew\right)\right| \]
  10. Step-by-step derivation
    1. lift-*.f64N/A

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

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

      \[\leadsto \left|\left(t \cdot t\right) \cdot \color{blue}{\left(ew \cdot \frac{-1}{2}\right)} + ew\right| \]
    4. associate-*r*N/A

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

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

      \[\leadsto \left|\color{blue}{\left(ew \cdot \left(t \cdot t\right)\right)} \cdot \frac{-1}{2} + ew\right| \]
    7. lower-fma.f6438.2

      \[\leadsto \left|\color{blue}{\mathsf{fma}\left(ew \cdot \left(t \cdot t\right), -0.5, ew\right)}\right| \]
    8. lift-*.f64N/A

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

      \[\leadsto \left|\mathsf{fma}\left(ew \cdot \color{blue}{\left(t \cdot t\right)}, \frac{-1}{2}, ew\right)\right| \]
    10. associate-*r*N/A

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

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

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

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

      \[\leadsto \left|\mathsf{fma}\left(t \cdot \color{blue}{\left(t \cdot ew\right)}, -0.5, ew\right)\right| \]
  11. Applied egg-rr38.3%

    \[\leadsto \left|\color{blue}{\mathsf{fma}\left(t \cdot \left(t \cdot ew\right), -0.5, ew\right)}\right| \]
  12. Final simplification38.3%

    \[\leadsto \left|\mathsf{fma}\left(t \cdot \left(ew \cdot t\right), -0.5, ew\right)\right| \]
  13. Add Preprocessing

Alternative 10: 38.8% accurate, 45.4× speedup?

\[\begin{array}{l} \\ \left|\mathsf{fma}\left(t \cdot t, ew \cdot -0.5, ew\right)\right| \end{array} \]
(FPCore (eh ew t) :precision binary64 (fabs (fma (* t t) (* ew -0.5) ew)))
double code(double eh, double ew, double t) {
	return fabs(fma((t * t), (ew * -0.5), ew));
}
function code(eh, ew, t)
	return abs(fma(Float64(t * t), Float64(ew * -0.5), ew))
end
code[eh_, ew_, t_] := N[Abs[N[(N[(t * t), $MachinePrecision] * N[(ew * -0.5), $MachinePrecision] + ew), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}

\\
\left|\mathsf{fma}\left(t \cdot t, ew \cdot -0.5, ew\right)\right|
\end{array}
Derivation
  1. Initial program 99.8%

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

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

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

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

      \[\leadsto \left|{t}^{2} \cdot \color{blue}{\left(\frac{-1}{2} \cdot ew + \left(\frac{-1}{2} \cdot \frac{{eh}^{2}}{ew} - -1 \cdot \frac{{eh}^{2}}{ew}\right)\right)} + ew\right| \]
    3. cancel-sign-sub-invN/A

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

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

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

      \[\leadsto \left|\color{blue}{\mathsf{fma}\left({t}^{2}, \frac{-1}{2} \cdot ew + \left(\frac{-1}{2} \cdot \frac{{eh}^{2}}{ew} + \frac{{eh}^{2}}{ew}\right), ew\right)}\right| \]
  6. Simplified32.6%

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

    \[\leadsto \left|\mathsf{fma}\left(t \cdot t, \color{blue}{\frac{-1}{2} \cdot ew}, ew\right)\right| \]
  8. Step-by-step derivation
    1. *-commutativeN/A

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

      \[\leadsto \left|\mathsf{fma}\left(t \cdot t, \color{blue}{ew \cdot -0.5}, ew\right)\right| \]
  9. Simplified38.2%

    \[\leadsto \left|\mathsf{fma}\left(t \cdot t, \color{blue}{ew \cdot -0.5}, ew\right)\right| \]
  10. Add Preprocessing

Alternative 11: 4.9% accurate, 47.9× speedup?

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

\\
\left|-0.5 \cdot \left(ew \cdot \left(t \cdot t\right)\right)\right|
\end{array}
Derivation
  1. Initial program 99.8%

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

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

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

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

      \[\leadsto \left|{t}^{2} \cdot \color{blue}{\left(\frac{-1}{2} \cdot ew + \left(\frac{-1}{2} \cdot \frac{{eh}^{2}}{ew} - -1 \cdot \frac{{eh}^{2}}{ew}\right)\right)} + ew\right| \]
    3. cancel-sign-sub-invN/A

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

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

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

      \[\leadsto \left|\color{blue}{\mathsf{fma}\left({t}^{2}, \frac{-1}{2} \cdot ew + \left(\frac{-1}{2} \cdot \frac{{eh}^{2}}{ew} + \frac{{eh}^{2}}{ew}\right), ew\right)}\right| \]
  6. Simplified32.6%

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

    \[\leadsto \left|\mathsf{fma}\left(t \cdot t, \color{blue}{\frac{-1}{2} \cdot ew}, ew\right)\right| \]
  8. Step-by-step derivation
    1. *-commutativeN/A

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

      \[\leadsto \left|\mathsf{fma}\left(t \cdot t, \color{blue}{ew \cdot -0.5}, ew\right)\right| \]
  9. Simplified38.2%

    \[\leadsto \left|\mathsf{fma}\left(t \cdot t, \color{blue}{ew \cdot -0.5}, ew\right)\right| \]
  10. Taylor expanded in t around inf

    \[\leadsto \left|\color{blue}{\frac{-1}{2} \cdot \left(ew \cdot {t}^{2}\right)}\right| \]
  11. Step-by-step derivation
    1. lower-*.f64N/A

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

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

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

      \[\leadsto \left|\frac{-1}{2} \cdot \left(\color{blue}{\left(t \cdot t\right)} \cdot ew\right)\right| \]
    5. lower-*.f644.8

      \[\leadsto \left|-0.5 \cdot \left(\color{blue}{\left(t \cdot t\right)} \cdot ew\right)\right| \]
  12. Simplified4.8%

    \[\leadsto \left|\color{blue}{-0.5 \cdot \left(\left(t \cdot t\right) \cdot ew\right)}\right| \]
  13. Final simplification4.8%

    \[\leadsto \left|-0.5 \cdot \left(ew \cdot \left(t \cdot t\right)\right)\right| \]
  14. Add Preprocessing

Reproduce

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