Example 2 from Robby

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

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 17 alternatives:

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

Initial Program: 99.8% accurate, 1.0× speedup?

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

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

Alternative 1: 99.8% accurate, 0.9× speedup?

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

\\
\begin{array}{l}
t_1 := \tan^{-1} \left(eh \cdot \frac{\tan t}{-ew}\right)\\
\left|\mathsf{fma}\left(ew, \cos t\_1 \cdot \left(-\cos t\right), eh \cdot \left(\sin t \cdot \sin t\_1\right)\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. Step-by-step derivation
    1. fabs-sub99.8%

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

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

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

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

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

      \[\leadsto \left|\color{blue}{\mathsf{fma}\left(ew, -\cos t \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)}\right| \]
  3. Simplified99.8%

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

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

Alternative 2: 99.8% accurate, 1.0× speedup?

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

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

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

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

Alternative 3: 98.0% accurate, 1.0× speedup?

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

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

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

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

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

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

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

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

      \[\leadsto \left|\color{blue}{\mathsf{fma}\left(ew, -\cos t \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)}\right| \]
  3. Simplified99.8%

    \[\leadsto \color{blue}{\left|\mathsf{fma}\left(ew, \cos \tan^{-1} \left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right) \cdot \left(-\cos t\right), eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right)\right)\right)\right|} \]
  4. Add Preprocessing
  5. Step-by-step derivation
    1. add-cube-cbrt99.3%

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

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

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

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

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

Alternative 4: 89.9% accurate, 1.5× speedup?

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

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

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

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

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

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

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

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

      \[\leadsto \left|\color{blue}{\mathsf{fma}\left(ew, -\cos t \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)}\right| \]
  3. Simplified99.8%

    \[\leadsto \color{blue}{\left|\mathsf{fma}\left(ew, \cos \tan^{-1} \left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right) \cdot \left(-\cos t\right), eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right)\right)\right)\right|} \]
  4. Add Preprocessing
  5. Step-by-step derivation
    1. add-cube-cbrt99.3%

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

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

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

    \[\leadsto \left|\color{blue}{ew \cdot \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| \]
  8. Step-by-step derivation
    1. associate-*r*92.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \left|ew \cdot \left(\cos t + \frac{\color{blue}{\left(0 - eh \cdot \sin t\right)} \cdot \sin \tan^{-1} \left(\tan t \cdot \left(-\frac{eh}{ew}\right)\right)}{ew}\right)\right| \]
  12. Step-by-step derivation
    1. neg-sub092.8%

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

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

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

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

Alternative 5: 89.9% accurate, 1.5× speedup?

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

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

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

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

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

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

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

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

      \[\leadsto \left|\color{blue}{\mathsf{fma}\left(ew, -\cos t \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)}\right| \]
  3. Simplified99.8%

    \[\leadsto \color{blue}{\left|\mathsf{fma}\left(ew, \cos \tan^{-1} \left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right) \cdot \left(-\cos t\right), eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right)\right)\right)\right|} \]
  4. Add Preprocessing
  5. Step-by-step derivation
    1. add-cube-cbrt99.3%

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

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

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

    \[\leadsto \left|\color{blue}{ew \cdot \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| \]
  8. Step-by-step derivation
    1. associate-*r*92.8%

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 89.8% accurate, 1.5× speedup?

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

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

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

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

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

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

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

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

      \[\leadsto \left|\color{blue}{\mathsf{fma}\left(ew, -\cos t \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)}\right| \]
  3. Simplified99.8%

    \[\leadsto \color{blue}{\left|\mathsf{fma}\left(ew, \cos \tan^{-1} \left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right) \cdot \left(-\cos t\right), eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right)\right)\right)\right|} \]
  4. Add Preprocessing
  5. Step-by-step derivation
    1. add-cube-cbrt99.3%

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

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

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

    \[\leadsto \left|\color{blue}{ew \cdot \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| \]
  8. Step-by-step derivation
    1. associate-*r*92.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 89.8% accurate, 1.5× speedup?

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

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

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

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

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

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

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

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

      \[\leadsto \left|\color{blue}{\mathsf{fma}\left(ew, -\cos t \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)}\right| \]
  3. Simplified99.8%

    \[\leadsto \color{blue}{\left|\mathsf{fma}\left(ew, \cos \tan^{-1} \left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right) \cdot \left(-\cos t\right), eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right)\right)\right)\right|} \]
  4. Add Preprocessing
  5. Step-by-step derivation
    1. add-cube-cbrt99.3%

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

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

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

    \[\leadsto \left|\color{blue}{ew \cdot \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| \]
  8. Step-by-step derivation
    1. associate-/l*92.7%

      \[\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| \]
    2. associate-/l*92.7%

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

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

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

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

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

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

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

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

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

Alternative 8: 76.4% accurate, 1.7× speedup?

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

\\
\begin{array}{l}
t_1 := \sin \tan^{-1} \left(eh \cdot \frac{\tan t}{ew}\right)\\
t_2 := \left|ew \cdot \cos t\right|\\
\mathbf{if}\;ew \leq -5 \cdot 10^{-124}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;ew \leq 9.5 \cdot 10^{-189}:\\
\;\;\;\;\left|\left(eh \cdot \sin t\right) \cdot t\_1\right|\\

\mathbf{elif}\;ew \leq 1.8 \cdot 10^{-17}:\\
\;\;\;\;ew \cdot \left(\cos t + eh \cdot \frac{\sin t \cdot t\_1}{ew}\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if ew < -5.0000000000000003e-124 or 1.79999999999999997e-17 < 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. Step-by-step derivation
      1. fabs-sub99.8%

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

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

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

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

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

        \[\leadsto \left|\color{blue}{\mathsf{fma}\left(ew, -\cos t \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)}\right| \]
    3. Simplified99.8%

      \[\leadsto \color{blue}{\left|\mathsf{fma}\left(ew, \cos \tan^{-1} \left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right) \cdot \left(-\cos t\right), eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right)\right)\right)\right|} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. add-cube-cbrt99.1%

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

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

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

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

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

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

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

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

    if -5.0000000000000003e-124 < ew < 9.499999999999999e-189

    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. Step-by-step derivation
      1. fabs-sub99.8%

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

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

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

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

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

        \[\leadsto \left|\color{blue}{\mathsf{fma}\left(ew, -\cos t \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)}\right| \]
    3. Simplified99.8%

      \[\leadsto \color{blue}{\left|\mathsf{fma}\left(ew, \cos \tan^{-1} \left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right) \cdot \left(-\cos t\right), eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right)\right)\right)\right|} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. log1p-expm1-u99.8%

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

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

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

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

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

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

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

        \[\leadsto \left|\mathsf{fma}\left(ew, \cos \tan^{-1} \left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right) \cdot \left(-\cos t\right), eh \cdot \mathsf{log1p}\left(\mathsf{expm1}\left(\sin t \cdot \sin \tan^{-1} \left(\tan t \cdot \frac{\color{blue}{\sqrt{\left(-eh\right) \cdot \left(-eh\right)}}}{ew}\right)\right)\right)\right)\right| \]
      9. sqr-neg89.6%

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

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

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

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

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

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

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

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

    if 9.499999999999999e-189 < ew < 1.79999999999999997e-17

    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. Applied egg-rr86.1%

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

      \[\leadsto \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)} \]
    5. Step-by-step derivation
      1. associate-/l*79.3%

        \[\leadsto 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) \]
      2. associate-/l*79.3%

        \[\leadsto 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) \]
    6. Simplified79.3%

      \[\leadsto \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)} \]
  3. Recombined 3 regimes into one program.
  4. Add Preprocessing

Alternative 9: 74.8% accurate, 1.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;ew \leq -8.6 \cdot 10^{-123} \lor \neg \left(ew \leq 3 \cdot 10^{-97}\right):\\
\;\;\;\;\left|ew \cdot \cos t\right|\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if ew < -8.60000000000000064e-123 or 3.00000000000000024e-97 < 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. Step-by-step derivation
      1. fabs-sub99.8%

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

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

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

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

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

        \[\leadsto \left|\color{blue}{\mathsf{fma}\left(ew, -\cos t \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)}\right| \]
    3. Simplified99.8%

      \[\leadsto \color{blue}{\left|\mathsf{fma}\left(ew, \cos \tan^{-1} \left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right) \cdot \left(-\cos t\right), eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right)\right)\right)\right|} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. add-cube-cbrt99.1%

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

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

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

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

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

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

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

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

    if -8.60000000000000064e-123 < ew < 3.00000000000000024e-97

    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. Step-by-step derivation
      1. fabs-sub99.8%

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

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

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

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

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

        \[\leadsto \left|\color{blue}{\mathsf{fma}\left(ew, -\cos t \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)}\right| \]
    3. Simplified99.8%

      \[\leadsto \color{blue}{\left|\mathsf{fma}\left(ew, \cos \tan^{-1} \left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right) \cdot \left(-\cos t\right), eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right)\right)\right)\right|} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. log1p-expm1-u99.8%

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

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

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

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

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

        \[\leadsto \left|\mathsf{fma}\left(ew, \cos \tan^{-1} \left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right) \cdot \left(-\cos t\right), eh \cdot \mathsf{log1p}\left(\mathsf{expm1}\left(\sin t \cdot \sin \tan^{-1} \color{blue}{\left(\tan t \cdot \frac{-eh}{ew}\right)}\right)\right)\right)\right| \]
      7. add-sqr-sqrt54.9%

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

        \[\leadsto \left|\mathsf{fma}\left(ew, \cos \tan^{-1} \left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right) \cdot \left(-\cos t\right), eh \cdot \mathsf{log1p}\left(\mathsf{expm1}\left(\sin t \cdot \sin \tan^{-1} \left(\tan t \cdot \frac{\color{blue}{\sqrt{\left(-eh\right) \cdot \left(-eh\right)}}}{ew}\right)\right)\right)\right)\right| \]
      9. sqr-neg91.5%

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

        \[\leadsto \left|\mathsf{fma}\left(ew, \cos \tan^{-1} \left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right) \cdot \left(-\cos t\right), eh \cdot \mathsf{log1p}\left(\mathsf{expm1}\left(\sin t \cdot \sin \tan^{-1} \left(\tan t \cdot \frac{\color{blue}{\sqrt{eh} \cdot \sqrt{eh}}}{ew}\right)\right)\right)\right)\right| \]
      11. add-sqr-sqrt98.6%

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

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

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

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

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

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

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

Alternative 10: 89.5% accurate, 1.8× speedup?

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

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

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

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

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

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

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

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

      \[\leadsto \left|\color{blue}{\mathsf{fma}\left(ew, -\cos t \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)}\right| \]
  3. Simplified99.8%

    \[\leadsto \color{blue}{\left|\mathsf{fma}\left(ew, \cos \tan^{-1} \left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right) \cdot \left(-\cos t\right), eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right)\right)\right)\right|} \]
  4. Add Preprocessing
  5. Step-by-step derivation
    1. add-cube-cbrt99.3%

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

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

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

    \[\leadsto \left|\color{blue}{ew \cdot \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| \]
  8. Step-by-step derivation
    1. associate-*r*92.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 11: 73.4% accurate, 2.2× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.9 \cdot 10^{-5} \lor \neg \left(t \leq 6.5 \cdot 10^{-7}\right):\\
\;\;\;\;\left|ew \cdot \cos t\right|\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -1.9000000000000001e-5 or 6.50000000000000024e-7 < t

    1. Initial program 99.6%

      \[\left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right| \]
    2. Step-by-step derivation
      1. fabs-sub99.6%

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

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

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

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

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

        \[\leadsto \left|\color{blue}{\mathsf{fma}\left(ew, -\cos t \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)}\right| \]
    3. Simplified99.6%

      \[\leadsto \color{blue}{\left|\mathsf{fma}\left(ew, \cos \tan^{-1} \left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right) \cdot \left(-\cos t\right), eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right)\right)\right)\right|} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. add-cube-cbrt98.7%

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

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

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

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

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

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

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

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

    if -1.9000000000000001e-5 < t < 6.50000000000000024e-7

    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. Step-by-step derivation
      1. fabs-sub100.0%

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

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

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

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

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

        \[\leadsto \left|\color{blue}{\mathsf{fma}\left(ew, -\cos t \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)}\right| \]
    3. Simplified100.0%

      \[\leadsto \color{blue}{\left|\mathsf{fma}\left(ew, \cos \tan^{-1} \left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right) \cdot \left(-\cos t\right), eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right)\right)\right)\right|} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. add-cube-cbrt100.0%

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

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

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

      \[\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| \]
    8. Step-by-step derivation
      1. associate-*r*98.8%

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

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

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

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

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

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

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

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

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

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

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

Alternative 12: 67.3% accurate, 2.2× speedup?

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

\\
\begin{array}{l}
t_1 := \left|ew \cdot \cos t\right|\\
t_2 := eh \cdot \sin t\\
\mathbf{if}\;ew \leq -2 \cdot 10^{-125}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;ew \leq -1.9 \cdot 10^{-297}:\\
\;\;\;\;t\_2 \cdot \left(-\sin \tan^{-1} \left(eh \cdot \frac{\tan t}{ew}\right)\right)\\

\mathbf{elif}\;ew \leq 1.38 \cdot 10^{-99}:\\
\;\;\;\;t\_2 \cdot \sin \tan^{-1} \left(\frac{eh \cdot t}{ew}\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if ew < -2.00000000000000002e-125 or 1.38e-99 < 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. Step-by-step derivation
      1. fabs-sub99.8%

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

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

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

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

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

        \[\leadsto \left|\color{blue}{\mathsf{fma}\left(ew, -\cos t \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)}\right| \]
    3. Simplified99.8%

      \[\leadsto \color{blue}{\left|\mathsf{fma}\left(ew, \cos \tan^{-1} \left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right) \cdot \left(-\cos t\right), eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right)\right)\right)\right|} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. add-cube-cbrt99.1%

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

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

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

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

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

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

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

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

    if -2.00000000000000002e-125 < ew < -1.90000000000000002e-297

    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. Applied egg-rr23.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\left(0 - eh \cdot \sin t\right)} \cdot \sin \tan^{-1} \left(eh \cdot \frac{\tan t}{ew}\right) \]
    9. Step-by-step derivation
      1. neg-sub084.9%

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

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

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

    if -1.90000000000000002e-297 < ew < 1.38e-99

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 13: 64.1% accurate, 2.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;ew \leq -4.1 \cdot 10^{-203} \lor \neg \left(ew \leq 1.4 \cdot 10^{-99}\right):\\
\;\;\;\;\left|ew \cdot \cos t\right|\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if ew < -4.09999999999999981e-203 or 1.4e-99 < 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. Step-by-step derivation
      1. fabs-sub99.8%

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

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

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

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

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

        \[\leadsto \left|\color{blue}{\mathsf{fma}\left(ew, -\cos t \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)}\right| \]
    3. Simplified99.8%

      \[\leadsto \color{blue}{\left|\mathsf{fma}\left(ew, \cos \tan^{-1} \left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right) \cdot \left(-\cos t\right), eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right)\right)\right)\right|} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. add-cube-cbrt99.2%

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

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

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

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

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

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

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

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

    if -4.09999999999999981e-203 < ew < 1.4e-99

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 14: 60.6% accurate, 4.5× speedup?

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

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

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

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

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

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

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

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

      \[\leadsto \left|\color{blue}{\mathsf{fma}\left(ew, -\cos t \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)}\right| \]
  3. Simplified99.8%

    \[\leadsto \color{blue}{\left|\mathsf{fma}\left(ew, \cos \tan^{-1} \left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right) \cdot \left(-\cos t\right), eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right)\right)\right)\right|} \]
  4. Add Preprocessing
  5. Step-by-step derivation
    1. add-cube-cbrt99.3%

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

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

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

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

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

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

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

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

Alternative 15: 47.8% accurate, 8.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t \leq -2 \cdot 10^{-14} \lor \neg \left(t \leq 6.5 \cdot 10^{-7}\right):\\ \;\;\;\;ew \cdot \cos t\\ \mathbf{else}:\\ \;\;\;\;\left|ew\right|\\ \end{array} \end{array} \]
(FPCore (eh ew t)
 :precision binary64
 (if (or (<= t -2e-14) (not (<= t 6.5e-7))) (* ew (cos t)) (fabs ew)))
double code(double eh, double ew, double t) {
	double tmp;
	if ((t <= -2e-14) || !(t <= 6.5e-7)) {
		tmp = ew * cos(t);
	} else {
		tmp = fabs(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 ((t <= (-2d-14)) .or. (.not. (t <= 6.5d-7))) then
        tmp = ew * cos(t)
    else
        tmp = abs(ew)
    end if
    code = tmp
end function
public static double code(double eh, double ew, double t) {
	double tmp;
	if ((t <= -2e-14) || !(t <= 6.5e-7)) {
		tmp = ew * Math.cos(t);
	} else {
		tmp = Math.abs(ew);
	}
	return tmp;
}
def code(eh, ew, t):
	tmp = 0
	if (t <= -2e-14) or not (t <= 6.5e-7):
		tmp = ew * math.cos(t)
	else:
		tmp = math.fabs(ew)
	return tmp
function code(eh, ew, t)
	tmp = 0.0
	if ((t <= -2e-14) || !(t <= 6.5e-7))
		tmp = Float64(ew * cos(t));
	else
		tmp = abs(ew);
	end
	return tmp
end
function tmp_2 = code(eh, ew, t)
	tmp = 0.0;
	if ((t <= -2e-14) || ~((t <= 6.5e-7)))
		tmp = ew * cos(t);
	else
		tmp = abs(ew);
	end
	tmp_2 = tmp;
end
code[eh_, ew_, t_] := If[Or[LessEqual[t, -2e-14], N[Not[LessEqual[t, 6.5e-7]], $MachinePrecision]], N[(ew * N[Cos[t], $MachinePrecision]), $MachinePrecision], N[Abs[ew], $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;t \leq -2 \cdot 10^{-14} \lor \neg \left(t \leq 6.5 \cdot 10^{-7}\right):\\
\;\;\;\;ew \cdot \cos t\\

\mathbf{else}:\\
\;\;\;\;\left|ew\right|\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -2e-14 or 6.50000000000000024e-7 < t

    1. Initial program 99.6%

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

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

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

    if -2e-14 < t < 6.50000000000000024e-7

    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. Step-by-step derivation
      1. fabs-sub100.0%

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

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

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

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

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

        \[\leadsto \left|\color{blue}{\mathsf{fma}\left(ew, -\cos t \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)}\right| \]
    3. Simplified100.0%

      \[\leadsto \color{blue}{\left|\mathsf{fma}\left(ew, \cos \tan^{-1} \left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right) \cdot \left(-\cos t\right), eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right)\right)\right)\right|} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. add-cube-cbrt100.0%

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

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

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

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

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

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

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

      \[\leadsto \left|\color{blue}{ew}\right| \]
  3. Recombined 2 regimes into one program.
  4. Final simplification53.6%

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -2 \cdot 10^{-14} \lor \neg \left(t \leq 6.5 \cdot 10^{-7}\right):\\ \;\;\;\;ew \cdot \cos t\\ \mathbf{else}:\\ \;\;\;\;\left|ew\right|\\ \end{array} \]
  5. Add Preprocessing

Alternative 16: 41.4% accurate, 9.1× speedup?

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

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

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

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

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

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

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

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

      \[\leadsto \left|\color{blue}{\mathsf{fma}\left(ew, -\cos t \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)}\right| \]
  3. Simplified99.8%

    \[\leadsto \color{blue}{\left|\mathsf{fma}\left(ew, \cos \tan^{-1} \left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right) \cdot \left(-\cos t\right), eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right)\right)\right)\right|} \]
  4. Add Preprocessing
  5. Step-by-step derivation
    1. add-cube-cbrt99.3%

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

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

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

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

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

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

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

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

Alternative 17: 21.3% accurate, 921.0× speedup?

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

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

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

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

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

Reproduce

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