Example 2 from Robby

Percentage Accurate: 99.8% → 99.8%
Time: 19.1s
Alternatives: 16
Speedup: 1.1×

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 16 alternatives:

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

Initial Program: 99.8% accurate, 1.0× speedup?

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

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

Alternative 1: 99.8% accurate, 1.1× speedup?

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

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

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

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

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

Alternative 2: 98.4% accurate, 1.1× speedup?

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

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

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

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

    \[\leadsto \left|\color{blue}{\frac{ew \cdot \cos t}{\mathsf{hypot}\left(1, \tan t \cdot \frac{eh}{ew}\right)} + eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\tan t \cdot \frac{eh}{ew}\right)\right)}\right| \]
  5. Step-by-step derivation
    1. add-cbrt-cube99.6%

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

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

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

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

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

Alternative 3: 98.0% accurate, 1.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;ew \leq -1.5 \cdot 10^{-108} \lor \neg \left(ew \leq 6000\right):\\
\;\;\;\;\left|ew \cdot \left(\cos t + eh \cdot \frac{\sin t \cdot \sin \tan^{-1} \left(eh \cdot \frac{\tan t}{ew}\right)}{ew}\right)\right|\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if ew < -1.49999999999999996e-108 or 6e3 < ew

    1. Initial program 99.8%

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

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

      \[\leadsto \left|\color{blue}{\frac{ew \cdot \cos t}{\mathsf{hypot}\left(1, \tan t \cdot \frac{eh}{ew}\right)} + eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\tan t \cdot \frac{eh}{ew}\right)\right)}\right| \]
    5. Step-by-step derivation
      1. add-exp-log77.7%

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

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

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

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

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

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

    if -1.49999999999999996e-108 < ew < 6e3

    1. Initial program 99.7%

      \[\left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right| \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. add-sqr-sqrt53.1%

        \[\leadsto \left|\color{blue}{\sqrt{\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)} \cdot \sqrt{\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. pow253.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 90.4% accurate, 1.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;eh \leq -1.18 \cdot 10^{+122}:\\
\;\;\;\;\left|\left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\tan t \cdot \frac{eh}{-ew}\right)\right|\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if eh < -1.18000000000000003e122

    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 ew around 0 75.7%

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

        \[\leadsto \left|\color{blue}{-eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(-1 \cdot \frac{eh \cdot \tan t}{ew}\right)\right)}\right| \]
      2. associate-*r*75.8%

        \[\leadsto \left|-\color{blue}{\left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(-1 \cdot \frac{eh \cdot \tan t}{ew}\right)}\right| \]
      3. distribute-rgt-neg-in75.8%

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

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

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

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

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

        \[\leadsto \left|\left(eh \cdot \sin t\right) \cdot \left(-\sin \tan^{-1} \left(-\color{blue}{\tan t \cdot \frac{eh}{ew}}\right)\right)\right| \]
      9. distribute-rgt-neg-in75.8%

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

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

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

    if -1.18000000000000003e122 < 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. Step-by-step derivation
      1. sub-neg99.8%

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

      \[\leadsto \left|\color{blue}{\frac{ew \cdot \cos t}{\mathsf{hypot}\left(1, \tan t \cdot \frac{eh}{ew}\right)} + eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\tan t \cdot \frac{eh}{ew}\right)\right)}\right| \]
    5. Step-by-step derivation
      1. add-exp-log71.1%

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

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

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

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

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

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

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

Alternative 5: 75.9% accurate, 1.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \tan^{-1} \left(\tan t \cdot \frac{eh}{-ew}\right)\\ \mathbf{if}\;ew \leq -1.1 \cdot 10^{-102} \lor \neg \left(ew \leq 1.55 \cdot 10^{-87}\right):\\ \;\;\;\;\left|\left(ew \cdot \cos t\right) \cdot \cos t\_1\right|\\ \mathbf{else}:\\ \;\;\;\;\left|\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 (* (tan t) (/ eh (- ew))))))
   (if (or (<= ew -1.1e-102) (not (<= ew 1.55e-87)))
     (fabs (* (* ew (cos t)) (cos t_1)))
     (fabs (* (* eh (sin t)) (sin t_1))))))
double code(double eh, double ew, double t) {
	double t_1 = atan((tan(t) * (eh / -ew)));
	double tmp;
	if ((ew <= -1.1e-102) || !(ew <= 1.55e-87)) {
		tmp = fabs(((ew * cos(t)) * cos(t_1)));
	} else {
		tmp = fabs(((eh * sin(t)) * sin(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 = atan((tan(t) * (eh / -ew)))
    if ((ew <= (-1.1d-102)) .or. (.not. (ew <= 1.55d-87))) then
        tmp = abs(((ew * cos(t)) * cos(t_1)))
    else
        tmp = abs(((eh * sin(t)) * sin(t_1)))
    end if
    code = tmp
end function
public static double code(double eh, double ew, double t) {
	double t_1 = Math.atan((Math.tan(t) * (eh / -ew)));
	double tmp;
	if ((ew <= -1.1e-102) || !(ew <= 1.55e-87)) {
		tmp = Math.abs(((ew * Math.cos(t)) * Math.cos(t_1)));
	} else {
		tmp = Math.abs(((eh * Math.sin(t)) * Math.sin(t_1)));
	}
	return tmp;
}
def code(eh, ew, t):
	t_1 = math.atan((math.tan(t) * (eh / -ew)))
	tmp = 0
	if (ew <= -1.1e-102) or not (ew <= 1.55e-87):
		tmp = math.fabs(((ew * math.cos(t)) * math.cos(t_1)))
	else:
		tmp = math.fabs(((eh * math.sin(t)) * math.sin(t_1)))
	return tmp
function code(eh, ew, t)
	t_1 = atan(Float64(tan(t) * Float64(eh / Float64(-ew))))
	tmp = 0.0
	if ((ew <= -1.1e-102) || !(ew <= 1.55e-87))
		tmp = abs(Float64(Float64(ew * cos(t)) * cos(t_1)));
	else
		tmp = abs(Float64(Float64(eh * sin(t)) * sin(t_1)));
	end
	return tmp
end
function tmp_2 = code(eh, ew, t)
	t_1 = atan((tan(t) * (eh / -ew)));
	tmp = 0.0;
	if ((ew <= -1.1e-102) || ~((ew <= 1.55e-87)))
		tmp = abs(((ew * cos(t)) * cos(t_1)));
	else
		tmp = abs(((eh * sin(t)) * sin(t_1)));
	end
	tmp_2 = tmp;
end
code[eh_, ew_, t_] := Block[{t$95$1 = N[ArcTan[N[(N[Tan[t], $MachinePrecision] * N[(eh / (-ew)), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[Or[LessEqual[ew, -1.1e-102], N[Not[LessEqual[ew, 1.55e-87]], $MachinePrecision]], N[Abs[N[(N[(ew * N[Cos[t], $MachinePrecision]), $MachinePrecision] * N[Cos[t$95$1], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Abs[N[(N[(eh * N[Sin[t], $MachinePrecision]), $MachinePrecision] * N[Sin[t$95$1], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \tan^{-1} \left(\tan t \cdot \frac{eh}{-ew}\right)\\
\mathbf{if}\;ew \leq -1.1 \cdot 10^{-102} \lor \neg \left(ew \leq 1.55 \cdot 10^{-87}\right):\\
\;\;\;\;\left|\left(ew \cdot \cos t\right) \cdot \cos t\_1\right|\\

\mathbf{else}:\\
\;\;\;\;\left|\left(eh \cdot \sin t\right) \cdot \sin t\_1\right|\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if ew < -1.10000000000000006e-102 or 1.54999999999999999e-87 < 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. Taylor expanded in ew around inf 86.7%

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

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

        \[\leadsto \left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \color{blue}{\left(\frac{-1 \cdot \left(eh \cdot \tan t\right)}{ew}\right)}\right| \]
      3. neg-mul-186.7%

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

        \[\leadsto \left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{-\color{blue}{\tan t \cdot eh}}{ew}\right)\right| \]
      5. distribute-rgt-neg-in86.7%

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

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

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

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

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

    if -1.10000000000000006e-102 < ew < 1.54999999999999999e-87

    1. Initial program 99.7%

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

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

        \[\leadsto \left|\color{blue}{-eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(-1 \cdot \frac{eh \cdot \tan t}{ew}\right)\right)}\right| \]
      2. associate-*r*78.5%

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 75.6% accurate, 1.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \tan^{-1} \left(\tan t \cdot \frac{eh}{-ew}\right)\\ \mathbf{if}\;t \leq -240000 \lor \neg \left(t \leq 0.078\right):\\ \;\;\;\;\left|\left(ew \cdot \cos t\right) \cdot \cos t\_1\right|\\ \mathbf{else}:\\ \;\;\;\;\left|ew + t \cdot \left(-0.5 \cdot \left(ew \cdot t\right) - eh \cdot \sin t\_1\right)\right|\\ \end{array} \end{array} \]
(FPCore (eh ew t)
 :precision binary64
 (let* ((t_1 (atan (* (tan t) (/ eh (- ew))))))
   (if (or (<= t -240000.0) (not (<= t 0.078)))
     (fabs (* (* ew (cos t)) (cos t_1)))
     (fabs (+ ew (* t (- (* -0.5 (* ew t)) (* eh (sin t_1)))))))))
double code(double eh, double ew, double t) {
	double t_1 = atan((tan(t) * (eh / -ew)));
	double tmp;
	if ((t <= -240000.0) || !(t <= 0.078)) {
		tmp = fabs(((ew * cos(t)) * cos(t_1)));
	} else {
		tmp = fabs((ew + (t * ((-0.5 * (ew * t)) - (eh * sin(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 = atan((tan(t) * (eh / -ew)))
    if ((t <= (-240000.0d0)) .or. (.not. (t <= 0.078d0))) then
        tmp = abs(((ew * cos(t)) * cos(t_1)))
    else
        tmp = abs((ew + (t * (((-0.5d0) * (ew * t)) - (eh * sin(t_1))))))
    end if
    code = tmp
end function
public static double code(double eh, double ew, double t) {
	double t_1 = Math.atan((Math.tan(t) * (eh / -ew)));
	double tmp;
	if ((t <= -240000.0) || !(t <= 0.078)) {
		tmp = Math.abs(((ew * Math.cos(t)) * Math.cos(t_1)));
	} else {
		tmp = Math.abs((ew + (t * ((-0.5 * (ew * t)) - (eh * Math.sin(t_1))))));
	}
	return tmp;
}
def code(eh, ew, t):
	t_1 = math.atan((math.tan(t) * (eh / -ew)))
	tmp = 0
	if (t <= -240000.0) or not (t <= 0.078):
		tmp = math.fabs(((ew * math.cos(t)) * math.cos(t_1)))
	else:
		tmp = math.fabs((ew + (t * ((-0.5 * (ew * t)) - (eh * math.sin(t_1))))))
	return tmp
function code(eh, ew, t)
	t_1 = atan(Float64(tan(t) * Float64(eh / Float64(-ew))))
	tmp = 0.0
	if ((t <= -240000.0) || !(t <= 0.078))
		tmp = abs(Float64(Float64(ew * cos(t)) * cos(t_1)));
	else
		tmp = abs(Float64(ew + Float64(t * Float64(Float64(-0.5 * Float64(ew * t)) - Float64(eh * sin(t_1))))));
	end
	return tmp
end
function tmp_2 = code(eh, ew, t)
	t_1 = atan((tan(t) * (eh / -ew)));
	tmp = 0.0;
	if ((t <= -240000.0) || ~((t <= 0.078)))
		tmp = abs(((ew * cos(t)) * cos(t_1)));
	else
		tmp = abs((ew + (t * ((-0.5 * (ew * t)) - (eh * sin(t_1))))));
	end
	tmp_2 = tmp;
end
code[eh_, ew_, t_] := Block[{t$95$1 = N[ArcTan[N[(N[Tan[t], $MachinePrecision] * N[(eh / (-ew)), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[Or[LessEqual[t, -240000.0], N[Not[LessEqual[t, 0.078]], $MachinePrecision]], N[Abs[N[(N[(ew * N[Cos[t], $MachinePrecision]), $MachinePrecision] * N[Cos[t$95$1], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Abs[N[(ew + N[(t * N[(N[(-0.5 * N[(ew * t), $MachinePrecision]), $MachinePrecision] - N[(eh * N[Sin[t$95$1], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \tan^{-1} \left(\tan t \cdot \frac{eh}{-ew}\right)\\
\mathbf{if}\;t \leq -240000 \lor \neg \left(t \leq 0.078\right):\\
\;\;\;\;\left|\left(ew \cdot \cos t\right) \cdot \cos t\_1\right|\\

\mathbf{else}:\\
\;\;\;\;\left|ew + t \cdot \left(-0.5 \cdot \left(ew \cdot t\right) - eh \cdot \sin t\_1\right)\right|\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -2.4e5 or 0.0779999999999999999 < t

    1. Initial program 99.5%

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

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

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

        \[\leadsto \left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \color{blue}{\left(\frac{-1 \cdot \left(eh \cdot \tan t\right)}{ew}\right)}\right| \]
      3. neg-mul-154.1%

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

        \[\leadsto \left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{-\color{blue}{\tan t \cdot eh}}{ew}\right)\right| \]
      5. distribute-rgt-neg-in54.1%

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

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

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

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

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

    if -2.4e5 < t < 0.0779999999999999999

    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. Step-by-step derivation
      1. add-sqr-sqrt52.2%

        \[\leadsto \left|\color{blue}{\sqrt{\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)} \cdot \sqrt{\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. pow252.2%

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

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

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

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

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

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

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

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

        \[\leadsto \left|ew \cdot \left(\cos t - eh \cdot \frac{\sin t \cdot \sin \tan^{-1} \left(-\color{blue}{\tan t \cdot \frac{eh}{ew}}\right)}{ew}\right)\right| \]
      7. distribute-rgt-neg-in94.2%

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

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

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

      \[\leadsto \left|\color{blue}{ew + t \cdot \left(-1 \cdot \left(eh \cdot \sin \tan^{-1} \left(-1 \cdot \frac{eh \cdot \tan t}{ew}\right)\right) + -0.5 \cdot \left(ew \cdot t\right)\right)}\right| \]
    9. Step-by-step derivation
      1. +-commutative97.5%

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

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

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

        \[\leadsto \left|ew + t \cdot \left(-0.5 \cdot \left(ew \cdot t\right) - eh \cdot \sin \tan^{-1} \color{blue}{\left(-\frac{eh \cdot \tan t}{ew}\right)}\right)\right| \]
      5. associate-*l/97.5%

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

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

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

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

Alternative 7: 55.7% accurate, 2.2× speedup?

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

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

    \[\left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right| \]
  2. Add Preprocessing
  3. Step-by-step derivation
    1. add-sqr-sqrt53.2%

      \[\leadsto \left|\color{blue}{\sqrt{\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)} \cdot \sqrt{\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. pow253.2%

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

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

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

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

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

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

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

      \[\leadsto \left|ew - eh \cdot \left(t \cdot \sin \tan^{-1} \left(-\color{blue}{\tan t \cdot \frac{eh}{ew}}\right)\right)\right| \]
    6. distribute-rgt-neg-in59.6%

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

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

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

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

Alternative 8: 55.6% accurate, 2.2× speedup?

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

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

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

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

    \[\leadsto \left|\color{blue}{\frac{ew \cdot \cos t}{\mathsf{hypot}\left(1, \tan t \cdot \frac{eh}{ew}\right)} + eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\tan t \cdot \frac{eh}{ew}\right)\right)}\right| \]
  5. Step-by-step derivation
    1. add-exp-log67.6%

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

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

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

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

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

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

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

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

Alternative 9: 42.7% accurate, 2.3× speedup?

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

\\
\left|ew \cdot \cos \tan^{-1} \left(\tan t \cdot \frac{eh}{-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 46.2%

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

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

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

      \[\leadsto \left|ew \cdot \cos \tan^{-1} \left(\frac{-\color{blue}{\tan t \cdot eh}}{ew}\right)\right| \]
    4. distribute-rgt-neg-in46.2%

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

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

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

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

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

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

Alternative 10: 42.5% accurate, 3.0× speedup?

\[\begin{array}{l} \\ \left|ew \cdot \frac{1}{\mathsf{hypot}\left(1, eh \cdot \frac{\tan t}{ew}\right)}\right| \end{array} \]
(FPCore (eh ew t)
 :precision binary64
 (fabs (* ew (/ 1.0 (hypot 1.0 (* eh (/ (tan t) ew)))))))
double code(double eh, double ew, double t) {
	return fabs((ew * (1.0 / hypot(1.0, (eh * (tan(t) / ew))))));
}
public static double code(double eh, double ew, double t) {
	return Math.abs((ew * (1.0 / Math.hypot(1.0, (eh * (Math.tan(t) / ew))))));
}
def code(eh, ew, t):
	return math.fabs((ew * (1.0 / math.hypot(1.0, (eh * (math.tan(t) / ew))))))
function code(eh, ew, t)
	return abs(Float64(ew * Float64(1.0 / hypot(1.0, Float64(eh * Float64(tan(t) / ew))))))
end
function tmp = code(eh, ew, t)
	tmp = abs((ew * (1.0 / hypot(1.0, (eh * (tan(t) / ew))))));
end
code[eh_, ew_, t_] := N[Abs[N[(ew * N[(1.0 / N[Sqrt[1.0 ^ 2 + N[(eh * N[(N[Tan[t], $MachinePrecision] / ew), $MachinePrecision]), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}

\\
\left|ew \cdot \frac{1}{\mathsf{hypot}\left(1, eh \cdot \frac{\tan t}{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 46.2%

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

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

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

      \[\leadsto \left|ew \cdot \cos \tan^{-1} \left(\frac{-\color{blue}{\tan t \cdot eh}}{ew}\right)\right| \]
    4. distribute-rgt-neg-in46.2%

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

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

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

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

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

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

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

      \[\leadsto \left|ew \cdot \color{blue}{\frac{1}{\sqrt{1 + \frac{\left(-eh\right) \cdot \tan t}{ew} \cdot \frac{\left(-eh\right) \cdot \tan t}{ew}}}}\right| \]
    4. hypot-1-def46.0%

      \[\leadsto \left|ew \cdot \frac{1}{\color{blue}{\mathsf{hypot}\left(1, \frac{\left(-eh\right) \cdot \tan t}{ew}\right)}}\right| \]
    5. *-commutative46.0%

      \[\leadsto \left|ew \cdot \frac{1}{\mathsf{hypot}\left(1, \frac{\color{blue}{\tan t \cdot \left(-eh\right)}}{ew}\right)}\right| \]
    6. associate-*r/46.0%

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

    \[\leadsto \left|ew \cdot \color{blue}{\frac{1}{\mathsf{hypot}\left(1, \tan t \cdot \frac{-eh}{ew}\right)}}\right| \]
  8. Step-by-step derivation
    1. hypot-undefine45.9%

      \[\leadsto \left|ew \cdot \frac{1}{\color{blue}{\sqrt{1 \cdot 1 + \left(\tan t \cdot \frac{-eh}{ew}\right) \cdot \left(\tan t \cdot \frac{-eh}{ew}\right)}}}\right| \]
    2. swap-sqr43.8%

      \[\leadsto \left|ew \cdot \frac{1}{\sqrt{1 \cdot 1 + \color{blue}{\left(\tan t \cdot \tan t\right) \cdot \left(\frac{-eh}{ew} \cdot \frac{-eh}{ew}\right)}}}\right| \]
    3. distribute-frac-neg43.8%

      \[\leadsto \left|ew \cdot \frac{1}{\sqrt{1 \cdot 1 + \left(\tan t \cdot \tan t\right) \cdot \left(\color{blue}{\left(-\frac{eh}{ew}\right)} \cdot \frac{-eh}{ew}\right)}}\right| \]
    4. distribute-frac-neg43.8%

      \[\leadsto \left|ew \cdot \frac{1}{\sqrt{1 \cdot 1 + \left(\tan t \cdot \tan t\right) \cdot \left(\left(-\frac{eh}{ew}\right) \cdot \color{blue}{\left(-\frac{eh}{ew}\right)}\right)}}\right| \]
    5. sqr-neg43.8%

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

      \[\leadsto \left|ew \cdot \frac{1}{\sqrt{1 \cdot 1 + \color{blue}{\left(\tan t \cdot \frac{eh}{ew}\right) \cdot \left(\tan t \cdot \frac{eh}{ew}\right)}}}\right| \]
    7. hypot-undefine46.0%

      \[\leadsto \left|ew \cdot \frac{1}{\color{blue}{\mathsf{hypot}\left(1, \tan t \cdot \frac{eh}{ew}\right)}}\right| \]
    8. associate-*r/46.0%

      \[\leadsto \left|ew \cdot \frac{1}{\mathsf{hypot}\left(1, \color{blue}{\frac{\tan t \cdot eh}{ew}}\right)}\right| \]
    9. *-commutative46.0%

      \[\leadsto \left|ew \cdot \frac{1}{\mathsf{hypot}\left(1, \frac{\color{blue}{eh \cdot \tan t}}{ew}\right)}\right| \]
    10. associate-/l*46.0%

      \[\leadsto \left|ew \cdot \frac{1}{\mathsf{hypot}\left(1, \color{blue}{eh \cdot \frac{\tan t}{ew}}\right)}\right| \]
  9. Simplified46.0%

    \[\leadsto \left|ew \cdot \color{blue}{\frac{1}{\mathsf{hypot}\left(1, eh \cdot \frac{\tan t}{ew}\right)}}\right| \]
  10. Add Preprocessing

Alternative 11: 41.5% accurate, 3.0× speedup?

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

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

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

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

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

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

      \[\leadsto \left|ew \cdot \cos \tan^{-1} \left(\frac{-\color{blue}{\tan t \cdot eh}}{ew}\right)\right| \]
    4. distribute-rgt-neg-in46.2%

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

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

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

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

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

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

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

      \[\leadsto \left|ew \cdot \cos \tan^{-1} \left(-\color{blue}{eh \cdot \frac{t}{ew}}\right)\right| \]
    3. distribute-rgt-neg-in45.3%

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

    \[\leadsto \left|ew \cdot \cos \tan^{-1} \color{blue}{\left(eh \cdot \left(-\frac{t}{ew}\right)\right)}\right| \]
  9. Step-by-step derivation
    1. *-un-lft-identity45.3%

      \[\leadsto \color{blue}{1 \cdot \left|ew \cdot \cos \tan^{-1} \left(eh \cdot \left(-\frac{t}{ew}\right)\right)\right|} \]
    2. distribute-rgt-neg-out45.3%

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

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

    \[\leadsto \color{blue}{1 \cdot \left|ew \cdot \cos \left(-\tan^{-1} \left(eh \cdot \frac{t}{ew}\right)\right)\right|} \]
  11. Step-by-step derivation
    1. *-lft-identity45.3%

      \[\leadsto \color{blue}{\left|ew \cdot \cos \left(-\tan^{-1} \left(eh \cdot \frac{t}{ew}\right)\right)\right|} \]
    2. fabs-mul45.3%

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

      \[\leadsto \color{blue}{\left|\cos \left(-\tan^{-1} \left(eh \cdot \frac{t}{ew}\right)\right)\right| \cdot \left|ew\right|} \]
    4. rem-square-sqrt45.3%

      \[\leadsto \left|\color{blue}{\sqrt{\cos \left(-\tan^{-1} \left(eh \cdot \frac{t}{ew}\right)\right)} \cdot \sqrt{\cos \left(-\tan^{-1} \left(eh \cdot \frac{t}{ew}\right)\right)}}\right| \cdot \left|ew\right| \]
    5. fabs-sqr45.3%

      \[\leadsto \color{blue}{\left(\sqrt{\cos \left(-\tan^{-1} \left(eh \cdot \frac{t}{ew}\right)\right)} \cdot \sqrt{\cos \left(-\tan^{-1} \left(eh \cdot \frac{t}{ew}\right)\right)}\right)} \cdot \left|ew\right| \]
    6. rem-square-sqrt45.3%

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

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

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

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

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

Alternative 12: 41.3% accurate, 4.3× speedup?

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

\\
\left|ew \cdot \left(-0.5 \cdot {\left(t \cdot \frac{eh}{ew}\right)}^{2} + 1\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 46.2%

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

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

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

      \[\leadsto \left|ew \cdot \cos \tan^{-1} \left(\frac{-\color{blue}{\tan t \cdot eh}}{ew}\right)\right| \]
    4. distribute-rgt-neg-in46.2%

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

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

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

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

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

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

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

      \[\leadsto \left|ew \cdot \cos \tan^{-1} \left(-\color{blue}{eh \cdot \frac{t}{ew}}\right)\right| \]
    3. distribute-rgt-neg-in45.3%

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

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

      \[\leadsto \left|ew \cdot \color{blue}{\frac{1}{\sqrt{1 + \left(eh \cdot \left(-\frac{t}{ew}\right)\right) \cdot \left(eh \cdot \left(-\frac{t}{ew}\right)\right)}}}\right| \]
    2. hypot-1-def44.7%

      \[\leadsto \left|ew \cdot \frac{1}{\color{blue}{\mathsf{hypot}\left(1, eh \cdot \left(-\frac{t}{ew}\right)\right)}}\right| \]
    3. distribute-neg-frac244.7%

      \[\leadsto \left|ew \cdot \frac{1}{\mathsf{hypot}\left(1, eh \cdot \color{blue}{\frac{t}{-ew}}\right)}\right| \]
  10. Applied egg-rr44.7%

    \[\leadsto \left|ew \cdot \color{blue}{\frac{1}{\mathsf{hypot}\left(1, eh \cdot \frac{t}{-ew}\right)}}\right| \]
  11. Step-by-step derivation
    1. distribute-frac-neg244.7%

      \[\leadsto \left|ew \cdot \frac{1}{\mathsf{hypot}\left(1, eh \cdot \color{blue}{\left(-\frac{t}{ew}\right)}\right)}\right| \]
    2. distribute-neg-frac44.7%

      \[\leadsto \left|ew \cdot \frac{1}{\mathsf{hypot}\left(1, eh \cdot \color{blue}{\frac{-t}{ew}}\right)}\right| \]
  12. Simplified44.7%

    \[\leadsto \left|ew \cdot \color{blue}{\frac{1}{\mathsf{hypot}\left(1, eh \cdot \frac{-t}{ew}\right)}}\right| \]
  13. Taylor expanded in ew around inf 32.0%

    \[\leadsto \left|\color{blue}{ew \cdot \left(1 + -0.5 \cdot \frac{{eh}^{2} \cdot {t}^{2}}{{ew}^{2}}\right)}\right| \]
  14. Step-by-step derivation
    1. associate-/l*31.8%

      \[\leadsto \left|ew \cdot \left(1 + -0.5 \cdot \color{blue}{\left({eh}^{2} \cdot \frac{{t}^{2}}{{ew}^{2}}\right)}\right)\right| \]
    2. unpow231.8%

      \[\leadsto \left|ew \cdot \left(1 + -0.5 \cdot \left(\color{blue}{\left(eh \cdot eh\right)} \cdot \frac{{t}^{2}}{{ew}^{2}}\right)\right)\right| \]
    3. unpow231.8%

      \[\leadsto \left|ew \cdot \left(1 + -0.5 \cdot \left(\left(eh \cdot eh\right) \cdot \frac{\color{blue}{t \cdot t}}{{ew}^{2}}\right)\right)\right| \]
    4. unpow231.8%

      \[\leadsto \left|ew \cdot \left(1 + -0.5 \cdot \left(\left(eh \cdot eh\right) \cdot \frac{t \cdot t}{\color{blue}{ew \cdot ew}}\right)\right)\right| \]
    5. times-frac36.9%

      \[\leadsto \left|ew \cdot \left(1 + -0.5 \cdot \left(\left(eh \cdot eh\right) \cdot \color{blue}{\left(\frac{t}{ew} \cdot \frac{t}{ew}\right)}\right)\right)\right| \]
    6. swap-sqr45.2%

      \[\leadsto \left|ew \cdot \left(1 + -0.5 \cdot \color{blue}{\left(\left(eh \cdot \frac{t}{ew}\right) \cdot \left(eh \cdot \frac{t}{ew}\right)\right)}\right)\right| \]
    7. unpow145.2%

      \[\leadsto \left|ew \cdot \left(1 + -0.5 \cdot \left(\color{blue}{{\left(eh \cdot \frac{t}{ew}\right)}^{1}} \cdot \left(eh \cdot \frac{t}{ew}\right)\right)\right)\right| \]
    8. pow-plus45.2%

      \[\leadsto \left|ew \cdot \left(1 + -0.5 \cdot \color{blue}{{\left(eh \cdot \frac{t}{ew}\right)}^{\left(1 + 1\right)}}\right)\right| \]
    9. *-commutative45.2%

      \[\leadsto \left|ew \cdot \left(1 + -0.5 \cdot {\color{blue}{\left(\frac{t}{ew} \cdot eh\right)}}^{\left(1 + 1\right)}\right)\right| \]
    10. associate-*l/45.2%

      \[\leadsto \left|ew \cdot \left(1 + -0.5 \cdot {\color{blue}{\left(\frac{t \cdot eh}{ew}\right)}}^{\left(1 + 1\right)}\right)\right| \]
    11. associate-/l*45.2%

      \[\leadsto \left|ew \cdot \left(1 + -0.5 \cdot {\color{blue}{\left(t \cdot \frac{eh}{ew}\right)}}^{\left(1 + 1\right)}\right)\right| \]
    12. metadata-eval45.2%

      \[\leadsto \left|ew \cdot \left(1 + -0.5 \cdot {\left(t \cdot \frac{eh}{ew}\right)}^{\color{blue}{2}}\right)\right| \]
  15. Simplified45.2%

    \[\leadsto \left|\color{blue}{ew \cdot \left(1 + -0.5 \cdot {\left(t \cdot \frac{eh}{ew}\right)}^{2}\right)}\right| \]
  16. Final simplification45.2%

    \[\leadsto \left|ew \cdot \left(-0.5 \cdot {\left(t \cdot \frac{eh}{ew}\right)}^{2} + 1\right)\right| \]
  17. Add Preprocessing

Alternative 13: 40.7% accurate, 4.4× speedup?

\[\begin{array}{l} \\ \left|\frac{ew}{\mathsf{hypot}\left(1, eh \cdot \frac{t}{-ew}\right)}\right| \end{array} \]
(FPCore (eh ew t)
 :precision binary64
 (fabs (/ ew (hypot 1.0 (* eh (/ t (- ew)))))))
double code(double eh, double ew, double t) {
	return fabs((ew / hypot(1.0, (eh * (t / -ew)))));
}
public static double code(double eh, double ew, double t) {
	return Math.abs((ew / Math.hypot(1.0, (eh * (t / -ew)))));
}
def code(eh, ew, t):
	return math.fabs((ew / math.hypot(1.0, (eh * (t / -ew)))))
function code(eh, ew, t)
	return abs(Float64(ew / hypot(1.0, Float64(eh * Float64(t / Float64(-ew))))))
end
function tmp = code(eh, ew, t)
	tmp = abs((ew / hypot(1.0, (eh * (t / -ew)))));
end
code[eh_, ew_, t_] := N[Abs[N[(ew / N[Sqrt[1.0 ^ 2 + N[(eh * N[(t / (-ew)), $MachinePrecision]), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}

\\
\left|\frac{ew}{\mathsf{hypot}\left(1, eh \cdot \frac{t}{-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 46.2%

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

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

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

      \[\leadsto \left|ew \cdot \cos \tan^{-1} \left(\frac{-\color{blue}{\tan t \cdot eh}}{ew}\right)\right| \]
    4. distribute-rgt-neg-in46.2%

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

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

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

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

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

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

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

      \[\leadsto \left|ew \cdot \cos \tan^{-1} \left(-\color{blue}{eh \cdot \frac{t}{ew}}\right)\right| \]
    3. distribute-rgt-neg-in45.3%

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

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

      \[\leadsto \left|ew \cdot \color{blue}{\frac{1}{\sqrt{1 + \left(eh \cdot \left(-\frac{t}{ew}\right)\right) \cdot \left(eh \cdot \left(-\frac{t}{ew}\right)\right)}}}\right| \]
    2. hypot-1-def44.7%

      \[\leadsto \left|ew \cdot \frac{1}{\color{blue}{\mathsf{hypot}\left(1, eh \cdot \left(-\frac{t}{ew}\right)\right)}}\right| \]
    3. distribute-neg-frac244.7%

      \[\leadsto \left|ew \cdot \frac{1}{\mathsf{hypot}\left(1, eh \cdot \color{blue}{\frac{t}{-ew}}\right)}\right| \]
  10. Applied egg-rr44.7%

    \[\leadsto \left|ew \cdot \color{blue}{\frac{1}{\mathsf{hypot}\left(1, eh \cdot \frac{t}{-ew}\right)}}\right| \]
  11. Step-by-step derivation
    1. distribute-frac-neg244.7%

      \[\leadsto \left|ew \cdot \frac{1}{\mathsf{hypot}\left(1, eh \cdot \color{blue}{\left(-\frac{t}{ew}\right)}\right)}\right| \]
    2. distribute-neg-frac44.7%

      \[\leadsto \left|ew \cdot \frac{1}{\mathsf{hypot}\left(1, eh \cdot \color{blue}{\frac{-t}{ew}}\right)}\right| \]
  12. Simplified44.7%

    \[\leadsto \left|ew \cdot \color{blue}{\frac{1}{\mathsf{hypot}\left(1, eh \cdot \frac{-t}{ew}\right)}}\right| \]
  13. Step-by-step derivation
    1. un-div-inv44.7%

      \[\leadsto \left|\color{blue}{\frac{ew}{\mathsf{hypot}\left(1, eh \cdot \frac{-t}{ew}\right)}}\right| \]
    2. distribute-frac-neg44.7%

      \[\leadsto \left|\frac{ew}{\mathsf{hypot}\left(1, eh \cdot \color{blue}{\left(-\frac{t}{ew}\right)}\right)}\right| \]
  14. Applied egg-rr44.7%

    \[\leadsto \left|\color{blue}{\frac{ew}{\mathsf{hypot}\left(1, eh \cdot \left(-\frac{t}{ew}\right)\right)}}\right| \]
  15. Final simplification44.7%

    \[\leadsto \left|\frac{ew}{\mathsf{hypot}\left(1, eh \cdot \frac{t}{-ew}\right)}\right| \]
  16. Add Preprocessing

Alternative 14: 40.7% accurate, 4.4× speedup?

\[\begin{array}{l} \\ \frac{\left|ew\right|}{\mathsf{hypot}\left(1, t \cdot \frac{eh}{ew}\right)} \end{array} \]
(FPCore (eh ew t)
 :precision binary64
 (/ (fabs ew) (hypot 1.0 (* t (/ eh ew)))))
double code(double eh, double ew, double t) {
	return fabs(ew) / hypot(1.0, (t * (eh / ew)));
}
public static double code(double eh, double ew, double t) {
	return Math.abs(ew) / Math.hypot(1.0, (t * (eh / ew)));
}
def code(eh, ew, t):
	return math.fabs(ew) / math.hypot(1.0, (t * (eh / ew)))
function code(eh, ew, t)
	return Float64(abs(ew) / hypot(1.0, Float64(t * Float64(eh / ew))))
end
function tmp = code(eh, ew, t)
	tmp = abs(ew) / hypot(1.0, (t * (eh / ew)));
end
code[eh_, ew_, t_] := N[(N[Abs[ew], $MachinePrecision] / N[Sqrt[1.0 ^ 2 + N[(t * N[(eh / ew), $MachinePrecision]), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\frac{\left|ew\right|}{\mathsf{hypot}\left(1, t \cdot \frac{eh}{ew}\right)}
\end{array}
Derivation
  1. Initial program 99.8%

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

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

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

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

      \[\leadsto \left|ew \cdot \cos \tan^{-1} \left(\frac{-\color{blue}{\tan t \cdot eh}}{ew}\right)\right| \]
    4. distribute-rgt-neg-in46.2%

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

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

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

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

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

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

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

      \[\leadsto \left|ew \cdot \cos \tan^{-1} \left(-\color{blue}{eh \cdot \frac{t}{ew}}\right)\right| \]
    3. distribute-rgt-neg-in45.3%

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

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

      \[\leadsto \left|ew \cdot \color{blue}{\frac{1}{\sqrt{1 + \left(eh \cdot \left(-\frac{t}{ew}\right)\right) \cdot \left(eh \cdot \left(-\frac{t}{ew}\right)\right)}}}\right| \]
    2. hypot-1-def44.7%

      \[\leadsto \left|ew \cdot \frac{1}{\color{blue}{\mathsf{hypot}\left(1, eh \cdot \left(-\frac{t}{ew}\right)\right)}}\right| \]
    3. distribute-neg-frac244.7%

      \[\leadsto \left|ew \cdot \frac{1}{\mathsf{hypot}\left(1, eh \cdot \color{blue}{\frac{t}{-ew}}\right)}\right| \]
  10. Applied egg-rr44.7%

    \[\leadsto \left|ew \cdot \color{blue}{\frac{1}{\mathsf{hypot}\left(1, eh \cdot \frac{t}{-ew}\right)}}\right| \]
  11. Step-by-step derivation
    1. distribute-frac-neg244.7%

      \[\leadsto \left|ew \cdot \frac{1}{\mathsf{hypot}\left(1, eh \cdot \color{blue}{\left(-\frac{t}{ew}\right)}\right)}\right| \]
    2. distribute-neg-frac44.7%

      \[\leadsto \left|ew \cdot \frac{1}{\mathsf{hypot}\left(1, eh \cdot \color{blue}{\frac{-t}{ew}}\right)}\right| \]
  12. Simplified44.7%

    \[\leadsto \left|ew \cdot \color{blue}{\frac{1}{\mathsf{hypot}\left(1, eh \cdot \frac{-t}{ew}\right)}}\right| \]
  13. Step-by-step derivation
    1. *-un-lft-identity44.7%

      \[\leadsto \color{blue}{1 \cdot \left|ew \cdot \frac{1}{\mathsf{hypot}\left(1, eh \cdot \frac{-t}{ew}\right)}\right|} \]
    2. un-div-inv44.7%

      \[\leadsto 1 \cdot \left|\color{blue}{\frac{ew}{\mathsf{hypot}\left(1, eh \cdot \frac{-t}{ew}\right)}}\right| \]
    3. distribute-frac-neg44.7%

      \[\leadsto 1 \cdot \left|\frac{ew}{\mathsf{hypot}\left(1, eh \cdot \color{blue}{\left(-\frac{t}{ew}\right)}\right)}\right| \]
  14. Applied egg-rr44.7%

    \[\leadsto \color{blue}{1 \cdot \left|\frac{ew}{\mathsf{hypot}\left(1, eh \cdot \left(-\frac{t}{ew}\right)\right)}\right|} \]
  15. Step-by-step derivation
    1. *-lft-identity44.7%

      \[\leadsto \color{blue}{\left|\frac{ew}{\mathsf{hypot}\left(1, eh \cdot \left(-\frac{t}{ew}\right)\right)}\right|} \]
    2. fabs-div44.7%

      \[\leadsto \color{blue}{\frac{\left|ew\right|}{\left|\mathsf{hypot}\left(1, eh \cdot \left(-\frac{t}{ew}\right)\right)\right|}} \]
    3. rem-square-sqrt44.7%

      \[\leadsto \frac{\left|ew\right|}{\left|\color{blue}{\sqrt{\mathsf{hypot}\left(1, eh \cdot \left(-\frac{t}{ew}\right)\right)} \cdot \sqrt{\mathsf{hypot}\left(1, eh \cdot \left(-\frac{t}{ew}\right)\right)}}\right|} \]
    4. fabs-sqr44.7%

      \[\leadsto \frac{\left|ew\right|}{\color{blue}{\sqrt{\mathsf{hypot}\left(1, eh \cdot \left(-\frac{t}{ew}\right)\right)} \cdot \sqrt{\mathsf{hypot}\left(1, eh \cdot \left(-\frac{t}{ew}\right)\right)}}} \]
    5. rem-square-sqrt44.7%

      \[\leadsto \frac{\left|ew\right|}{\color{blue}{\mathsf{hypot}\left(1, eh \cdot \left(-\frac{t}{ew}\right)\right)}} \]
    6. hypot-undefine44.6%

      \[\leadsto \frac{\left|ew\right|}{\color{blue}{\sqrt{1 \cdot 1 + \left(eh \cdot \left(-\frac{t}{ew}\right)\right) \cdot \left(eh \cdot \left(-\frac{t}{ew}\right)\right)}}} \]
    7. distribute-rgt-neg-out44.6%

      \[\leadsto \frac{\left|ew\right|}{\sqrt{1 \cdot 1 + \color{blue}{\left(-eh \cdot \frac{t}{ew}\right)} \cdot \left(eh \cdot \left(-\frac{t}{ew}\right)\right)}} \]
    8. distribute-rgt-neg-out44.6%

      \[\leadsto \frac{\left|ew\right|}{\sqrt{1 \cdot 1 + \left(-eh \cdot \frac{t}{ew}\right) \cdot \color{blue}{\left(-eh \cdot \frac{t}{ew}\right)}}} \]
    9. sqr-neg44.6%

      \[\leadsto \frac{\left|ew\right|}{\sqrt{1 \cdot 1 + \color{blue}{\left(eh \cdot \frac{t}{ew}\right) \cdot \left(eh \cdot \frac{t}{ew}\right)}}} \]
    10. hypot-undefine44.7%

      \[\leadsto \frac{\left|ew\right|}{\color{blue}{\mathsf{hypot}\left(1, eh \cdot \frac{t}{ew}\right)}} \]
    11. *-commutative44.7%

      \[\leadsto \frac{\left|ew\right|}{\mathsf{hypot}\left(1, \color{blue}{\frac{t}{ew} \cdot eh}\right)} \]
    12. associate-*l/44.5%

      \[\leadsto \frac{\left|ew\right|}{\mathsf{hypot}\left(1, \color{blue}{\frac{t \cdot eh}{ew}}\right)} \]
    13. associate-/l*44.6%

      \[\leadsto \frac{\left|ew\right|}{\mathsf{hypot}\left(1, \color{blue}{t \cdot \frac{eh}{ew}}\right)} \]
  16. Simplified44.6%

    \[\leadsto \color{blue}{\frac{\left|ew\right|}{\mathsf{hypot}\left(1, t \cdot \frac{eh}{ew}\right)}} \]
  17. Add Preprocessing

Alternative 15: 5.1% accurate, 8.4× speedup?

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

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

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

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

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

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

      \[\leadsto \left|ew \cdot \cos \tan^{-1} \left(\frac{-\color{blue}{\tan t \cdot eh}}{ew}\right)\right| \]
    4. distribute-rgt-neg-in46.2%

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

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

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

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

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

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

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

      \[\leadsto \left|ew \cdot \cos \tan^{-1} \left(-\color{blue}{eh \cdot \frac{t}{ew}}\right)\right| \]
    3. distribute-rgt-neg-in45.3%

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

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

      \[\leadsto \left|ew \cdot \color{blue}{\frac{1}{\sqrt{1 + \left(eh \cdot \left(-\frac{t}{ew}\right)\right) \cdot \left(eh \cdot \left(-\frac{t}{ew}\right)\right)}}}\right| \]
    2. hypot-1-def44.7%

      \[\leadsto \left|ew \cdot \frac{1}{\color{blue}{\mathsf{hypot}\left(1, eh \cdot \left(-\frac{t}{ew}\right)\right)}}\right| \]
    3. distribute-neg-frac244.7%

      \[\leadsto \left|ew \cdot \frac{1}{\mathsf{hypot}\left(1, eh \cdot \color{blue}{\frac{t}{-ew}}\right)}\right| \]
  10. Applied egg-rr44.7%

    \[\leadsto \left|ew \cdot \color{blue}{\frac{1}{\mathsf{hypot}\left(1, eh \cdot \frac{t}{-ew}\right)}}\right| \]
  11. Step-by-step derivation
    1. distribute-frac-neg244.7%

      \[\leadsto \left|ew \cdot \frac{1}{\mathsf{hypot}\left(1, eh \cdot \color{blue}{\left(-\frac{t}{ew}\right)}\right)}\right| \]
    2. distribute-neg-frac44.7%

      \[\leadsto \left|ew \cdot \frac{1}{\mathsf{hypot}\left(1, eh \cdot \color{blue}{\frac{-t}{ew}}\right)}\right| \]
  12. Simplified44.7%

    \[\leadsto \left|ew \cdot \color{blue}{\frac{1}{\mathsf{hypot}\left(1, eh \cdot \frac{-t}{ew}\right)}}\right| \]
  13. Taylor expanded in eh around inf 5.1%

    \[\leadsto \left|ew \cdot \frac{1}{\color{blue}{\frac{eh \cdot t}{ew}}}\right| \]
  14. Step-by-step derivation
    1. *-commutative5.1%

      \[\leadsto \left|ew \cdot \frac{1}{\frac{\color{blue}{t \cdot eh}}{ew}}\right| \]
    2. associate-/l*5.2%

      \[\leadsto \left|ew \cdot \frac{1}{\color{blue}{t \cdot \frac{eh}{ew}}}\right| \]
  15. Simplified5.2%

    \[\leadsto \left|ew \cdot \frac{1}{\color{blue}{t \cdot \frac{eh}{ew}}}\right| \]
  16. Add Preprocessing

Alternative 16: 5.0% accurate, 8.6× speedup?

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

\\
\left|ew \cdot \frac{ew}{t \cdot eh}\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 46.2%

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

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

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

      \[\leadsto \left|ew \cdot \cos \tan^{-1} \left(\frac{-\color{blue}{\tan t \cdot eh}}{ew}\right)\right| \]
    4. distribute-rgt-neg-in46.2%

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

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

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

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

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

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

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

      \[\leadsto \left|ew \cdot \cos \tan^{-1} \left(-\color{blue}{eh \cdot \frac{t}{ew}}\right)\right| \]
    3. distribute-rgt-neg-in45.3%

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

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

      \[\leadsto \left|ew \cdot \color{blue}{\frac{1}{\sqrt{1 + \left(eh \cdot \left(-\frac{t}{ew}\right)\right) \cdot \left(eh \cdot \left(-\frac{t}{ew}\right)\right)}}}\right| \]
    2. hypot-1-def44.7%

      \[\leadsto \left|ew \cdot \frac{1}{\color{blue}{\mathsf{hypot}\left(1, eh \cdot \left(-\frac{t}{ew}\right)\right)}}\right| \]
    3. distribute-neg-frac244.7%

      \[\leadsto \left|ew \cdot \frac{1}{\mathsf{hypot}\left(1, eh \cdot \color{blue}{\frac{t}{-ew}}\right)}\right| \]
  10. Applied egg-rr44.7%

    \[\leadsto \left|ew \cdot \color{blue}{\frac{1}{\mathsf{hypot}\left(1, eh \cdot \frac{t}{-ew}\right)}}\right| \]
  11. Step-by-step derivation
    1. distribute-frac-neg244.7%

      \[\leadsto \left|ew \cdot \frac{1}{\mathsf{hypot}\left(1, eh \cdot \color{blue}{\left(-\frac{t}{ew}\right)}\right)}\right| \]
    2. distribute-neg-frac44.7%

      \[\leadsto \left|ew \cdot \frac{1}{\mathsf{hypot}\left(1, eh \cdot \color{blue}{\frac{-t}{ew}}\right)}\right| \]
  12. Simplified44.7%

    \[\leadsto \left|ew \cdot \color{blue}{\frac{1}{\mathsf{hypot}\left(1, eh \cdot \frac{-t}{ew}\right)}}\right| \]
  13. Taylor expanded in eh around inf 5.1%

    \[\leadsto \left|ew \cdot \color{blue}{\frac{ew}{eh \cdot t}}\right| \]
  14. Step-by-step derivation
    1. *-commutative5.1%

      \[\leadsto \left|ew \cdot \frac{ew}{\color{blue}{t \cdot eh}}\right| \]
  15. Simplified5.1%

    \[\leadsto \left|ew \cdot \color{blue}{\frac{ew}{t \cdot eh}}\right| \]
  16. Add Preprocessing

Reproduce

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