Example 2 from Robby

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

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

Initial Program: 99.8% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \tan^{-1} \left(\frac{\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: 99.7% accurate, 1.1× speedup?

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

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

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

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

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

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

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

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

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

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

Alternative 4: 99.6% accurate, 1.1× speedup?

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \left|\frac{1}{\frac{\mathsf{hypot}\left(1, \frac{\color{blue}{eh \cdot \tan t}}{ew}\right)}{ew \cdot \cos t}} - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right| \]
    3. *-un-lft-identity99.7%

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

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

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

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

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

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

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

      \[\leadsto \left|\frac{1}{\frac{\frac{\mathsf{hypot}\left(1, \color{blue}{\frac{\tan t \cdot eh}{ew}}\right)}{\cos t}}{ew}} - \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|\frac{1}{\frac{\frac{\mathsf{hypot}\left(1, \color{blue}{\frac{\tan t}{ew} \cdot eh}\right)}{\cos t}}{ew}} - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right| \]
    5. *-commutative99.6%

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

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

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

Alternative 5: 98.4% accurate, 1.5× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 77.3% accurate, 1.7× speedup?

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

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

\mathbf{elif}\;ew \leq 3.8 \cdot 10^{-269}:\\
\;\;\;\;\left|\left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(eh \cdot \frac{t}{-ew}\right)\right|\\

\mathbf{elif}\;ew \leq 7.5 \cdot 10^{+86}:\\
\;\;\;\;t\_1 + eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\frac{eh \cdot \tan t}{ew}\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if ew < -6.0000000000000005e-104 or 7.4999999999999997e86 < 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-log-exp99.6%

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

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

        \[\leadsto \left|\mathsf{fma}\left(ew, \log \left(e^{\left(-\cos t\right) \cdot \color{blue}{\frac{1}{\sqrt{1 + \left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right) \cdot \left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right)}}}}\right), eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right)\right)\right)\right| \]
      4. un-div-inv99.6%

        \[\leadsto \left|\mathsf{fma}\left(ew, \log \left(e^{\color{blue}{\frac{-\cos t}{\sqrt{1 + \left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right) \cdot \left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right)}}}}\right), eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right)\right)\right)\right| \]
      5. add-sqr-sqrt27.4%

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

        \[\leadsto \left|\mathsf{fma}\left(ew, \log \left(e^{\frac{\color{blue}{\sqrt{\left(-\cos t\right) \cdot \left(-\cos t\right)}}}{\sqrt{1 + \left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right) \cdot \left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right)}}}\right), eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right)\right)\right)\right| \]
      7. sqr-neg99.4%

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

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

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

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

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

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

        \[\leadsto \left|\mathsf{fma}\left(ew, \log \left(e^{\frac{\cos t}{\mathsf{hypot}\left(1, \color{blue}{\tan t \cdot \frac{-eh}{ew}}\right)}}\right), 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}{\log \left(e^{\frac{\cos t}{\mathsf{hypot}\left(1, \tan t \cdot \frac{eh}{ew}\right)}}\right)}, 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 88.3%

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

    if -6.0000000000000005e-104 < ew < 3.8000000000000002e-269

    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-log-exp99.8%

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

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

        \[\leadsto \left|\mathsf{fma}\left(ew, \log \left(e^{\left(-\cos t\right) \cdot \color{blue}{\frac{1}{\sqrt{1 + \left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right) \cdot \left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right)}}}}\right), eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right)\right)\right)\right| \]
      4. un-div-inv99.8%

        \[\leadsto \left|\mathsf{fma}\left(ew, \log \left(e^{\color{blue}{\frac{-\cos t}{\sqrt{1 + \left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right) \cdot \left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right)}}}}\right), eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right)\right)\right)\right| \]
      5. add-sqr-sqrt21.0%

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

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

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

        \[\leadsto \left|\mathsf{fma}\left(ew, \log \left(e^{\frac{\color{blue}{\sqrt{\cos t} \cdot \sqrt{\cos t}}}{\sqrt{1 + \left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right) \cdot \left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right)}}}\right), eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right)\right)\right)\right| \]
      9. add-sqr-sqrt99.8%

        \[\leadsto \left|\mathsf{fma}\left(ew, \log \left(e^{\frac{\color{blue}{\cos t}}{\sqrt{1 + \left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right) \cdot \left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right)}}}\right), eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right)\right)\right)\right| \]
      10. hypot-1-def99.8%

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

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

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

        \[\leadsto \left|\mathsf{fma}\left(ew, \log \left(e^{\frac{\cos t}{\mathsf{hypot}\left(1, \color{blue}{\tan t \cdot \frac{-eh}{ew}}\right)}}\right), 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-rr99.8%

      \[\leadsto \left|\mathsf{fma}\left(ew, \color{blue}{\log \left(e^{\frac{\cos t}{\mathsf{hypot}\left(1, \tan t \cdot \frac{eh}{ew}\right)}}\right)}, 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 0 83.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 3.8000000000000002e-269 < ew < 7.4999999999999997e86

    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-rr46.5%

      \[\leadsto \color{blue}{\sqrt[3]{{\left(\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 0 73.5%

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

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

Alternative 7: 65.5% accurate, 2.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \left|ew \cdot \cos t\right|\\ \mathbf{if}\;ew \leq -1.6 \cdot 10^{-170}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;ew \leq -2.65 \cdot 10^{-303}:\\ \;\;\;\;\left|\sin \tan^{-1} \left(eh \cdot \frac{t}{-ew}\right) \cdot \left(eh \cdot t\right)\right|\\ \mathbf{elif}\;ew \leq 4.2 \cdot 10^{-116}:\\ \;\;\;\;eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\frac{eh \cdot \tan t}{ew}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (eh ew t)
 :precision binary64
 (let* ((t_1 (fabs (* ew (cos t)))))
   (if (<= ew -1.6e-170)
     t_1
     (if (<= ew -2.65e-303)
       (fabs (* (sin (atan (* eh (/ t (- ew))))) (* eh t)))
       (if (<= ew 4.2e-116)
         (* eh (* (sin t) (sin (atan (/ (* eh (tan t)) ew)))))
         t_1)))))
double code(double eh, double ew, double t) {
	double t_1 = fabs((ew * cos(t)));
	double tmp;
	if (ew <= -1.6e-170) {
		tmp = t_1;
	} else if (ew <= -2.65e-303) {
		tmp = fabs((sin(atan((eh * (t / -ew)))) * (eh * t)));
	} else if (ew <= 4.2e-116) {
		tmp = eh * (sin(t) * sin(atan(((eh * tan(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) :: tmp
    t_1 = abs((ew * cos(t)))
    if (ew <= (-1.6d-170)) then
        tmp = t_1
    else if (ew <= (-2.65d-303)) then
        tmp = abs((sin(atan((eh * (t / -ew)))) * (eh * t)))
    else if (ew <= 4.2d-116) then
        tmp = eh * (sin(t) * sin(atan(((eh * tan(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 tmp;
	if (ew <= -1.6e-170) {
		tmp = t_1;
	} else if (ew <= -2.65e-303) {
		tmp = Math.abs((Math.sin(Math.atan((eh * (t / -ew)))) * (eh * t)));
	} else if (ew <= 4.2e-116) {
		tmp = eh * (Math.sin(t) * Math.sin(Math.atan(((eh * Math.tan(t)) / ew))));
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(eh, ew, t):
	t_1 = math.fabs((ew * math.cos(t)))
	tmp = 0
	if ew <= -1.6e-170:
		tmp = t_1
	elif ew <= -2.65e-303:
		tmp = math.fabs((math.sin(math.atan((eh * (t / -ew)))) * (eh * t)))
	elif ew <= 4.2e-116:
		tmp = eh * (math.sin(t) * math.sin(math.atan(((eh * math.tan(t)) / ew))))
	else:
		tmp = t_1
	return tmp
function code(eh, ew, t)
	t_1 = abs(Float64(ew * cos(t)))
	tmp = 0.0
	if (ew <= -1.6e-170)
		tmp = t_1;
	elseif (ew <= -2.65e-303)
		tmp = abs(Float64(sin(atan(Float64(eh * Float64(t / Float64(-ew))))) * Float64(eh * t)));
	elseif (ew <= 4.2e-116)
		tmp = Float64(eh * Float64(sin(t) * sin(atan(Float64(Float64(eh * tan(t)) / ew)))));
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(eh, ew, t)
	t_1 = abs((ew * cos(t)));
	tmp = 0.0;
	if (ew <= -1.6e-170)
		tmp = t_1;
	elseif (ew <= -2.65e-303)
		tmp = abs((sin(atan((eh * (t / -ew)))) * (eh * t)));
	elseif (ew <= 4.2e-116)
		tmp = eh * (sin(t) * sin(atan(((eh * tan(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]}, If[LessEqual[ew, -1.6e-170], t$95$1, If[LessEqual[ew, -2.65e-303], N[Abs[N[(N[Sin[N[ArcTan[N[(eh * N[(t / (-ew)), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * N[(eh * t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[ew, 4.2e-116], N[(eh * N[(N[Sin[t], $MachinePrecision] * N[Sin[N[ArcTan[N[(N[(eh * N[Tan[t], $MachinePrecision]), $MachinePrecision] / ew), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}

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

\mathbf{elif}\;ew \leq -2.65 \cdot 10^{-303}:\\
\;\;\;\;\left|\sin \tan^{-1} \left(eh \cdot \frac{t}{-ew}\right) \cdot \left(eh \cdot t\right)\right|\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if ew < -1.6e-170 or 4.1999999999999998e-116 < 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-log-exp99.6%

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

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

        \[\leadsto \left|\mathsf{fma}\left(ew, \log \left(e^{\left(-\cos t\right) \cdot \color{blue}{\frac{1}{\sqrt{1 + \left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right) \cdot \left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right)}}}}\right), eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right)\right)\right)\right| \]
      4. un-div-inv99.6%

        \[\leadsto \left|\mathsf{fma}\left(ew, \log \left(e^{\color{blue}{\frac{-\cos t}{\sqrt{1 + \left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right) \cdot \left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right)}}}}\right), eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right)\right)\right)\right| \]
      5. add-sqr-sqrt28.7%

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

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

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

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

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

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

        \[\leadsto \left|\mathsf{fma}\left(ew, \log \left(e^{\frac{\cos t}{\mathsf{hypot}\left(1, \color{blue}{\frac{\left(-eh\right) \cdot \tan t}{ew}}\right)}}\right), eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right)\right)\right)\right| \]
      12. *-commutative98.7%

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

        \[\leadsto \left|\mathsf{fma}\left(ew, \log \left(e^{\frac{\cos t}{\mathsf{hypot}\left(1, \color{blue}{\tan t \cdot \frac{-eh}{ew}}\right)}}\right), 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}{\log \left(e^{\frac{\cos t}{\mathsf{hypot}\left(1, \tan t \cdot \frac{eh}{ew}\right)}}\right)}, 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 77.9%

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

    if -1.6e-170 < ew < -2.65e-303

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.65e-303 < ew < 4.1999999999999998e-116

    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-rr43.5%

      \[\leadsto \color{blue}{\sqrt[3]{{\left(\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 58.5%

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

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

Alternative 8: 75.0% accurate, 2.2× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;ew \leq -1.35 \cdot 10^{-101} \lor \neg \left(ew \leq 5.6 \cdot 10^{-115}\right):\\
\;\;\;\;\left|ew \cdot \cos t\right|\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if ew < -1.3500000000000001e-101 or 5.59999999999999974e-115 < 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-log-exp99.6%

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

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

        \[\leadsto \left|\mathsf{fma}\left(ew, \log \left(e^{\left(-\cos t\right) \cdot \color{blue}{\frac{1}{\sqrt{1 + \left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right) \cdot \left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right)}}}}\right), eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right)\right)\right)\right| \]
      4. un-div-inv99.6%

        \[\leadsto \left|\mathsf{fma}\left(ew, \log \left(e^{\color{blue}{\frac{-\cos t}{\sqrt{1 + \left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right) \cdot \left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right)}}}}\right), eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right)\right)\right)\right| \]
      5. add-sqr-sqrt29.1%

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

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

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

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

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

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

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

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

        \[\leadsto \left|\mathsf{fma}\left(ew, \log \left(e^{\frac{\cos t}{\mathsf{hypot}\left(1, \color{blue}{\tan t \cdot \frac{-eh}{ew}}\right)}}\right), 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}{\log \left(e^{\frac{\cos t}{\mathsf{hypot}\left(1, \tan t \cdot \frac{eh}{ew}\right)}}\right)}, 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 80.1%

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

    if -1.3500000000000001e-101 < ew < 5.59999999999999974e-115

    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.9%

        \[\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.9%

      \[\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-log-exp99.8%

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

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

        \[\leadsto \left|\mathsf{fma}\left(ew, \log \left(e^{\left(-\cos t\right) \cdot \color{blue}{\frac{1}{\sqrt{1 + \left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right) \cdot \left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right)}}}}\right), eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right)\right)\right)\right| \]
      4. un-div-inv99.8%

        \[\leadsto \left|\mathsf{fma}\left(ew, \log \left(e^{\color{blue}{\frac{-\cos t}{\sqrt{1 + \left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right) \cdot \left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right)}}}}\right), eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right)\right)\right)\right| \]
      5. add-sqr-sqrt18.5%

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

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

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

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

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

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

        \[\leadsto \left|\mathsf{fma}\left(ew, \log \left(e^{\frac{\cos t}{\mathsf{hypot}\left(1, \color{blue}{\frac{\left(-eh\right) \cdot \tan t}{ew}}\right)}}\right), eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right)\right)\right)\right| \]
      12. *-commutative99.2%

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

        \[\leadsto \left|\mathsf{fma}\left(ew, \log \left(e^{\frac{\cos t}{\mathsf{hypot}\left(1, \color{blue}{\tan t \cdot \frac{-eh}{ew}}\right)}}\right), 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-rr99.2%

      \[\leadsto \left|\mathsf{fma}\left(ew, \color{blue}{\log \left(e^{\frac{\cos t}{\mathsf{hypot}\left(1, \tan t \cdot \frac{eh}{ew}\right)}}\right)}, 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 0 78.1%

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

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

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

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

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

        \[\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.1%

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

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

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

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

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

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

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

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

Alternative 9: 65.4% accurate, 2.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \left|ew \cdot \cos t\right|\\ \mathbf{if}\;ew \leq -1.6 \cdot 10^{-170}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;ew \leq 1.75 \cdot 10^{-277}:\\ \;\;\;\;\left|\sin \tan^{-1} \left(eh \cdot \frac{t}{-ew}\right) \cdot \left(eh \cdot t\right)\right|\\ \mathbf{elif}\;ew \leq 1.06 \cdot 10^{-123}:\\ \;\;\;\;ew + eh \cdot \left(t \cdot \sin \tan^{-1} \left(\frac{eh \cdot \tan t}{ew}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (eh ew t)
 :precision binary64
 (let* ((t_1 (fabs (* ew (cos t)))))
   (if (<= ew -1.6e-170)
     t_1
     (if (<= ew 1.75e-277)
       (fabs (* (sin (atan (* eh (/ t (- ew))))) (* eh t)))
       (if (<= ew 1.06e-123)
         (+ ew (* eh (* t (sin (atan (/ (* eh (tan t)) ew))))))
         t_1)))))
double code(double eh, double ew, double t) {
	double t_1 = fabs((ew * cos(t)));
	double tmp;
	if (ew <= -1.6e-170) {
		tmp = t_1;
	} else if (ew <= 1.75e-277) {
		tmp = fabs((sin(atan((eh * (t / -ew)))) * (eh * t)));
	} else if (ew <= 1.06e-123) {
		tmp = ew + (eh * (t * sin(atan(((eh * tan(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) :: tmp
    t_1 = abs((ew * cos(t)))
    if (ew <= (-1.6d-170)) then
        tmp = t_1
    else if (ew <= 1.75d-277) then
        tmp = abs((sin(atan((eh * (t / -ew)))) * (eh * t)))
    else if (ew <= 1.06d-123) then
        tmp = ew + (eh * (t * sin(atan(((eh * tan(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 tmp;
	if (ew <= -1.6e-170) {
		tmp = t_1;
	} else if (ew <= 1.75e-277) {
		tmp = Math.abs((Math.sin(Math.atan((eh * (t / -ew)))) * (eh * t)));
	} else if (ew <= 1.06e-123) {
		tmp = ew + (eh * (t * Math.sin(Math.atan(((eh * Math.tan(t)) / ew)))));
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(eh, ew, t):
	t_1 = math.fabs((ew * math.cos(t)))
	tmp = 0
	if ew <= -1.6e-170:
		tmp = t_1
	elif ew <= 1.75e-277:
		tmp = math.fabs((math.sin(math.atan((eh * (t / -ew)))) * (eh * t)))
	elif ew <= 1.06e-123:
		tmp = ew + (eh * (t * math.sin(math.atan(((eh * math.tan(t)) / ew)))))
	else:
		tmp = t_1
	return tmp
function code(eh, ew, t)
	t_1 = abs(Float64(ew * cos(t)))
	tmp = 0.0
	if (ew <= -1.6e-170)
		tmp = t_1;
	elseif (ew <= 1.75e-277)
		tmp = abs(Float64(sin(atan(Float64(eh * Float64(t / Float64(-ew))))) * Float64(eh * t)));
	elseif (ew <= 1.06e-123)
		tmp = Float64(ew + Float64(eh * Float64(t * sin(atan(Float64(Float64(eh * tan(t)) / ew))))));
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(eh, ew, t)
	t_1 = abs((ew * cos(t)));
	tmp = 0.0;
	if (ew <= -1.6e-170)
		tmp = t_1;
	elseif (ew <= 1.75e-277)
		tmp = abs((sin(atan((eh * (t / -ew)))) * (eh * t)));
	elseif (ew <= 1.06e-123)
		tmp = ew + (eh * (t * sin(atan(((eh * tan(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]}, If[LessEqual[ew, -1.6e-170], t$95$1, If[LessEqual[ew, 1.75e-277], N[Abs[N[(N[Sin[N[ArcTan[N[(eh * N[(t / (-ew)), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * N[(eh * t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[ew, 1.06e-123], N[(ew + N[(eh * N[(t * N[Sin[N[ArcTan[N[(N[(eh * N[Tan[t], $MachinePrecision]), $MachinePrecision] / ew), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}

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

\mathbf{elif}\;ew \leq 1.75 \cdot 10^{-277}:\\
\;\;\;\;\left|\sin \tan^{-1} \left(eh \cdot \frac{t}{-ew}\right) \cdot \left(eh \cdot t\right)\right|\\

\mathbf{elif}\;ew \leq 1.06 \cdot 10^{-123}:\\
\;\;\;\;ew + eh \cdot \left(t \cdot \sin \tan^{-1} \left(\frac{eh \cdot \tan t}{ew}\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if ew < -1.6e-170 or 1.0599999999999999e-123 < 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-log-exp99.6%

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

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

        \[\leadsto \left|\mathsf{fma}\left(ew, \log \left(e^{\left(-\cos t\right) \cdot \color{blue}{\frac{1}{\sqrt{1 + \left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right) \cdot \left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right)}}}}\right), eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right)\right)\right)\right| \]
      4. un-div-inv99.6%

        \[\leadsto \left|\mathsf{fma}\left(ew, \log \left(e^{\color{blue}{\frac{-\cos t}{\sqrt{1 + \left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right) \cdot \left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right)}}}}\right), eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right)\right)\right)\right| \]
      5. add-sqr-sqrt28.2%

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

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

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

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

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

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

        \[\leadsto \left|\mathsf{fma}\left(ew, \log \left(e^{\frac{\cos t}{\mathsf{hypot}\left(1, \color{blue}{\frac{\left(-eh\right) \cdot \tan t}{ew}}\right)}}\right), eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right)\right)\right)\right| \]
      12. *-commutative98.7%

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

        \[\leadsto \left|\mathsf{fma}\left(ew, \log \left(e^{\frac{\cos t}{\mathsf{hypot}\left(1, \color{blue}{\tan t \cdot \frac{-eh}{ew}}\right)}}\right), 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}{\log \left(e^{\frac{\cos t}{\mathsf{hypot}\left(1, \tan t \cdot \frac{eh}{ew}\right)}}\right)}, 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 76.7%

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

    if -1.6e-170 < ew < 1.74999999999999991e-277

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.74999999999999991e-277 < ew < 1.0599999999999999e-123

    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-rr44.2%

      \[\leadsto \color{blue}{\sqrt[3]{{\left(\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 t around 0 58.8%

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

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

Alternative 10: 63.7% accurate, 2.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;ew \leq -1.5 \cdot 10^{-170} \lor \neg \left(ew \leq 6.2 \cdot 10^{-228}\right):\\
\;\;\;\;\left|ew \cdot \cos t\right|\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if ew < -1.50000000000000007e-170 or 6.1999999999999996e-228 < 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-log-exp99.7%

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

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

        \[\leadsto \left|\mathsf{fma}\left(ew, \log \left(e^{\left(-\cos t\right) \cdot \color{blue}{\frac{1}{\sqrt{1 + \left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right) \cdot \left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right)}}}}\right), eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right)\right)\right)\right| \]
      4. un-div-inv99.7%

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

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

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

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

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

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

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

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

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

        \[\leadsto \left|\mathsf{fma}\left(ew, \log \left(e^{\frac{\cos t}{\mathsf{hypot}\left(1, \color{blue}{\tan t \cdot \frac{-eh}{ew}}\right)}}\right), 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}{\log \left(e^{\frac{\cos t}{\mathsf{hypot}\left(1, \tan t \cdot \frac{eh}{ew}\right)}}\right)}, 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 72.4%

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

    if -1.50000000000000007e-170 < ew < 6.1999999999999996e-228

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 11: 62.1% 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-log-exp99.7%

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

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

      \[\leadsto \left|\mathsf{fma}\left(ew, \log \left(e^{\left(-\cos t\right) \cdot \color{blue}{\frac{1}{\sqrt{1 + \left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right) \cdot \left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right)}}}}\right), eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right)\right)\right)\right| \]
    4. un-div-inv99.7%

      \[\leadsto \left|\mathsf{fma}\left(ew, \log \left(e^{\color{blue}{\frac{-\cos t}{\sqrt{1 + \left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right) \cdot \left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right)}}}}\right), eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right)\right)\right)\right| \]
    5. add-sqr-sqrt25.5%

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

      \[\leadsto \left|\mathsf{fma}\left(ew, \log \left(e^{\frac{\color{blue}{\sqrt{\left(-\cos t\right) \cdot \left(-\cos t\right)}}}{\sqrt{1 + \left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right) \cdot \left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right)}}}\right), eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right)\right)\right)\right| \]
    7. sqr-neg99.4%

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

      \[\leadsto \left|\mathsf{fma}\left(ew, \log \left(e^{\frac{\color{blue}{\sqrt{\cos t} \cdot \sqrt{\cos t}}}{\sqrt{1 + \left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right) \cdot \left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right)}}}\right), eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right)\right)\right)\right| \]
    9. add-sqr-sqrt98.8%

      \[\leadsto \left|\mathsf{fma}\left(ew, \log \left(e^{\frac{\color{blue}{\cos t}}{\sqrt{1 + \left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right) \cdot \left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right)}}}\right), eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right)\right)\right)\right| \]
    10. hypot-1-def98.8%

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

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

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

      \[\leadsto \left|\mathsf{fma}\left(ew, \log \left(e^{\frac{\cos t}{\mathsf{hypot}\left(1, \color{blue}{\tan t \cdot \frac{-eh}{ew}}\right)}}\right), 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}{\log \left(e^{\frac{\cos t}{\mathsf{hypot}\left(1, \tan t \cdot \frac{eh}{ew}\right)}}\right)}, 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 62.0%

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

Alternative 12: 49.8% accurate, 8.1× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -0.041 \lor \neg \left(t \leq 0.095\right):\\
\;\;\;\;\cos t \cdot \left(-ew\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -0.0410000000000000017 or 0.095000000000000001 < 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-rr52.8%

      \[\leadsto \color{blue}{0 - \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)} \]
    4. Step-by-step derivation
      1. neg-sub052.8%

        \[\leadsto \color{blue}{-\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)} \]
      2. associate-*r/52.8%

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

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

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

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

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

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

      \[\leadsto \color{blue}{-1 \cdot \left(ew \cdot \cos t\right)} \]
    7. Step-by-step derivation
      1. neg-mul-129.5%

        \[\leadsto \color{blue}{-ew \cdot \cos t} \]
      2. distribute-rgt-neg-in29.5%

        \[\leadsto \color{blue}{ew \cdot \left(-\cos t\right)} \]
    8. Simplified29.5%

      \[\leadsto \color{blue}{ew \cdot \left(-\cos t\right)} \]

    if -0.0410000000000000017 < t < 0.095000000000000001

    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-log-exp100.0%

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

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

        \[\leadsto \left|\mathsf{fma}\left(ew, \log \left(e^{\left(-\cos t\right) \cdot \color{blue}{\frac{1}{\sqrt{1 + \left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right) \cdot \left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right)}}}}\right), eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right)\right)\right)\right| \]
      4. un-div-inv100.0%

        \[\leadsto \left|\mathsf{fma}\left(ew, \log \left(e^{\color{blue}{\frac{-\cos t}{\sqrt{1 + \left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right) \cdot \left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right)}}}}\right), eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right)\right)\right)\right| \]
      5. add-sqr-sqrt0.0%

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

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

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

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

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

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

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

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

        \[\leadsto \left|\mathsf{fma}\left(ew, \log \left(e^{\frac{\cos t}{\mathsf{hypot}\left(1, \color{blue}{\tan t \cdot \frac{-eh}{ew}}\right)}}\right), 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-rr99.6%

      \[\leadsto \left|\mathsf{fma}\left(ew, \color{blue}{\log \left(e^{\frac{\cos t}{\mathsf{hypot}\left(1, \tan t \cdot \frac{eh}{ew}\right)}}\right)}, 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 71.4%

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

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

Alternative 13: 43.1% 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-log-exp99.7%

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

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

      \[\leadsto \left|\mathsf{fma}\left(ew, \log \left(e^{\left(-\cos t\right) \cdot \color{blue}{\frac{1}{\sqrt{1 + \left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right) \cdot \left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right)}}}}\right), eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right)\right)\right)\right| \]
    4. un-div-inv99.7%

      \[\leadsto \left|\mathsf{fma}\left(ew, \log \left(e^{\color{blue}{\frac{-\cos t}{\sqrt{1 + \left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right) \cdot \left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right)}}}}\right), eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right)\right)\right)\right| \]
    5. add-sqr-sqrt25.5%

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

      \[\leadsto \left|\mathsf{fma}\left(ew, \log \left(e^{\frac{\color{blue}{\sqrt{\left(-\cos t\right) \cdot \left(-\cos t\right)}}}{\sqrt{1 + \left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right) \cdot \left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right)}}}\right), eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right)\right)\right)\right| \]
    7. sqr-neg99.4%

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

      \[\leadsto \left|\mathsf{fma}\left(ew, \log \left(e^{\frac{\color{blue}{\sqrt{\cos t} \cdot \sqrt{\cos t}}}{\sqrt{1 + \left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right) \cdot \left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right)}}}\right), eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right)\right)\right)\right| \]
    9. add-sqr-sqrt98.8%

      \[\leadsto \left|\mathsf{fma}\left(ew, \log \left(e^{\frac{\color{blue}{\cos t}}{\sqrt{1 + \left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right) \cdot \left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right)}}}\right), eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right)\right)\right)\right| \]
    10. hypot-1-def98.8%

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

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

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

      \[\leadsto \left|\mathsf{fma}\left(ew, \log \left(e^{\frac{\cos t}{\mathsf{hypot}\left(1, \color{blue}{\tan t \cdot \frac{-eh}{ew}}\right)}}\right), 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}{\log \left(e^{\frac{\cos t}{\mathsf{hypot}\left(1, \tan t \cdot \frac{eh}{ew}\right)}}\right)}, 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 43.8%

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

Alternative 14: 43.1% accurate, 131.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;ew \leq -2 \cdot 10^{-310}:\\ \;\;\;\;-ew\\ \mathbf{else}:\\ \;\;\;\;ew\\ \end{array} \end{array} \]
(FPCore (eh ew t) :precision binary64 (if (<= ew -2e-310) (- ew) ew))
double code(double eh, double ew, double t) {
	double tmp;
	if (ew <= -2e-310) {
		tmp = -ew;
	} else {
		tmp = 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 <= (-2d-310)) then
        tmp = -ew
    else
        tmp = ew
    end if
    code = tmp
end function
public static double code(double eh, double ew, double t) {
	double tmp;
	if (ew <= -2e-310) {
		tmp = -ew;
	} else {
		tmp = ew;
	}
	return tmp;
}
def code(eh, ew, t):
	tmp = 0
	if ew <= -2e-310:
		tmp = -ew
	else:
		tmp = ew
	return tmp
function code(eh, ew, t)
	tmp = 0.0
	if (ew <= -2e-310)
		tmp = Float64(-ew);
	else
		tmp = ew;
	end
	return tmp
end
function tmp_2 = code(eh, ew, t)
	tmp = 0.0;
	if (ew <= -2e-310)
		tmp = -ew;
	else
		tmp = ew;
	end
	tmp_2 = tmp;
end
code[eh_, ew_, t_] := If[LessEqual[ew, -2e-310], (-ew), ew]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;ew \leq -2 \cdot 10^{-310}:\\
\;\;\;\;-ew\\

\mathbf{else}:\\
\;\;\;\;ew\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if ew < -1.999999999999994e-310

    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-rr77.9%

      \[\leadsto \color{blue}{0 - \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)} \]
    4. Step-by-step derivation
      1. neg-sub077.9%

        \[\leadsto \color{blue}{-\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)} \]
      2. associate-*r/77.9%

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

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

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

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

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

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

      \[\leadsto \color{blue}{-1 \cdot ew} \]
    7. Step-by-step derivation
      1. neg-mul-146.0%

        \[\leadsto \color{blue}{-ew} \]
    8. Simplified46.0%

      \[\leadsto \color{blue}{-ew} \]

    if -1.999999999999994e-310 < ew

    1. Initial program 99.8%

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

      \[\leadsto \color{blue}{\sqrt[3]{{\left(\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 t around 0 15.3%

      \[\leadsto \sqrt[3]{\color{blue}{{ew}^{3}}} \]
    5. Step-by-step derivation
      1. rem-cbrt-cube42.0%

        \[\leadsto \color{blue}{ew} \]
      2. *-un-lft-identity42.0%

        \[\leadsto \color{blue}{1 \cdot ew} \]
    6. Applied egg-rr42.0%

      \[\leadsto \color{blue}{1 \cdot ew} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification43.8%

    \[\leadsto \begin{array}{l} \mathbf{if}\;ew \leq -2 \cdot 10^{-310}:\\ \;\;\;\;-ew\\ \mathbf{else}:\\ \;\;\;\;ew\\ \end{array} \]
  5. Add Preprocessing

Alternative 15: 22.3% accurate, 460.5× 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 Float64(-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-rr50.6%

    \[\leadsto \color{blue}{0 - \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)} \]
  4. Step-by-step derivation
    1. neg-sub050.6%

      \[\leadsto \color{blue}{-\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)} \]
    2. associate-*r/50.6%

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

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

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

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

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

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

    \[\leadsto \color{blue}{-1 \cdot ew} \]
  7. Step-by-step derivation
    1. neg-mul-121.0%

      \[\leadsto \color{blue}{-ew} \]
  8. Simplified21.0%

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

Reproduce

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