Example 2 from Robby

Percentage Accurate: 99.8% → 99.8%
Time: 15.6s
Alternatives: 12
Speedup: N/A×

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

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

Initial Program: 99.8% accurate, 1.0× speedup?

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

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

Alternative 1: 99.8% accurate, 1.0× speedup?

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

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

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

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

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

      \[\leadsto \left|\color{blue}{\mathsf{fma}\left(eh, \sin t \cdot \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. associate-*r/99.8%

      \[\leadsto \left|\mathsf{fma}\left(eh, \sin t \cdot \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)\right| \]
    4. associate-*l/99.8%

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

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

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

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

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

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

Alternative 2: 99.8% accurate, 1.1× speedup?

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

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

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

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

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

Alternative 3: 99.0% accurate, 1.1× speedup?

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

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

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

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

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

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

      \[\leadsto \left|\color{blue}{\mathsf{fma}\left(eh, \sin t \cdot \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. associate-*r/99.8%

      \[\leadsto \left|\mathsf{fma}\left(eh, \sin t \cdot \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)\right| \]
    4. associate-*l/99.8%

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

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

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

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

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

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

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

Alternative 4: 98.3% accurate, 1.5× speedup?

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

\\
\left|eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\tan t \cdot \frac{eh}{ew}\right)\right) + \frac{-1}{\frac{-1}{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. Add Preprocessing
  3. Step-by-step derivation
    1. sub-neg99.8%

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

    \[\leadsto \left|\color{blue}{\frac{ew \cdot \cos t}{\mathsf{hypot}\left(1, \tan t \cdot \frac{eh}{ew}\right)} + eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\tan t \cdot \frac{eh}{ew}\right)\right)}\right| \]
  5. Step-by-step derivation
    1. 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}}} + eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\tan t \cdot \frac{eh}{ew}\right)\right)\right| \]
    2. inv-pow99.7%

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

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

      \[\leadsto \left|\color{blue}{\frac{1}{\frac{\mathsf{hypot}\left(1, \tan t \cdot \frac{eh}{ew}\right)}{ew \cdot \cos t}}} + eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\tan t \cdot \frac{eh}{ew}\right)\right)\right| \]
    2. 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}} + eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\tan t \cdot \frac{eh}{ew}\right)\right)\right| \]
    3. associate-*l/99.7%

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

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

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

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

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

Alternative 5: 74.0% accurate, 1.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -7 \cdot 10^{+146}:\\
\;\;\;\;\left|ew \cdot \cos t\right|\\

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if t < -7.0000000000000002e146

    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. Step-by-step derivation
      1. sub-neg99.6%

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

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

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

        \[\leadsto \left|\color{blue}{\mathsf{fma}\left(eh, \sin t \cdot \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. associate-*r/99.5%

        \[\leadsto \left|\mathsf{fma}\left(eh, \sin t \cdot \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)\right| \]
      4. associate-*l/99.5%

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

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

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

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

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

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

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

    if -7.0000000000000002e146 < t < -8.8000000000000004e-7

    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. Step-by-step derivation
      1. sub-neg99.6%

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

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

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

        \[\leadsto \left|\color{blue}{\mathsf{fma}\left(eh, \sin t \cdot \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. associate-*r/99.7%

        \[\leadsto \left|\mathsf{fma}\left(eh, \sin t \cdot \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)\right| \]
      4. associate-*l/99.7%

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

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

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

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

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

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

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

    if -8.8000000000000004e-7 < t < 5.5999999999999999e-22

    1. Initial program 100.0%

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

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

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

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

        \[\leadsto \left|\color{blue}{\mathsf{fma}\left(eh, \sin t \cdot \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. associate-*r/100.0%

        \[\leadsto \left|\mathsf{fma}\left(eh, \sin t \cdot \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)\right| \]
      4. associate-*l/100.0%

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

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

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

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

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

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

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

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

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

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

    if 5.5999999999999999e-22 < t

    1. Initial program 99.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 74.0% accurate, 1.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.4 \cdot 10^{+147}:\\
\;\;\;\;\left|ew \cdot \cos t\right|\\

\mathbf{elif}\;t \leq -8.8 \cdot 10^{-7} \lor \neg \left(t \leq 5.6 \cdot 10^{-22}\right):\\
\;\;\;\;\left|eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\frac{eh \cdot \tan t}{ew}\right)\right)\right|\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -2.40000000000000002e147

    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. Step-by-step derivation
      1. sub-neg99.6%

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

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

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

        \[\leadsto \left|\color{blue}{\mathsf{fma}\left(eh, \sin t \cdot \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. associate-*r/99.5%

        \[\leadsto \left|\mathsf{fma}\left(eh, \sin t \cdot \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)\right| \]
      4. associate-*l/99.5%

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

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

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

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

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

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

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

    if -2.40000000000000002e147 < t < -8.8000000000000004e-7 or 5.5999999999999999e-22 < t

    1. Initial program 99.7%

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

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

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

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

        \[\leadsto \left|\color{blue}{\mathsf{fma}\left(eh, \sin t \cdot \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. associate-*r/99.7%

        \[\leadsto \left|\mathsf{fma}\left(eh, \sin t \cdot \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)\right| \]
      4. associate-*l/99.7%

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

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

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

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

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

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

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

    if -8.8000000000000004e-7 < t < 5.5999999999999999e-22

    1. Initial program 100.0%

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

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

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

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

        \[\leadsto \left|\color{blue}{\mathsf{fma}\left(eh, \sin t \cdot \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. associate-*r/100.0%

        \[\leadsto \left|\mathsf{fma}\left(eh, \sin t \cdot \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)\right| \]
      4. associate-*l/100.0%

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 71.8% accurate, 2.1× speedup?

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

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

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

\mathbf{elif}\;t \leq 2.2 \cdot 10^{+75}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -2.1e17 or 1.69999999999999996 < t < 2.20000000000000012e75

    1. Initial program 99.7%

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

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

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

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

        \[\leadsto \left|\color{blue}{\mathsf{fma}\left(eh, \sin t \cdot \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. associate-*r/99.6%

        \[\leadsto \left|\mathsf{fma}\left(eh, \sin t \cdot \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)\right| \]
      4. associate-*l/99.6%

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

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

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

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

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

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

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

    if -2.1e17 < t < 1.69999999999999996

    1. Initial program 100.0%

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

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

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

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

        \[\leadsto \left|\color{blue}{\mathsf{fma}\left(eh, \sin t \cdot \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. associate-*r/100.0%

        \[\leadsto \left|\mathsf{fma}\left(eh, \sin t \cdot \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)\right| \]
      4. associate-*l/100.0%

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

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

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

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

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

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

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

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

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

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

    if 2.20000000000000012e75 < t

    1. Initial program 99.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 8: 73.9% accurate, 2.2× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.1 \cdot 10^{+17} \lor \neg \left(t \leq 1.7\right):\\
\;\;\;\;\left|ew \cdot \cos t\right|\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -2.1e17 or 1.69999999999999996 < t

    1. Initial program 99.7%

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

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

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

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

        \[\leadsto \left|\color{blue}{\mathsf{fma}\left(eh, \sin t \cdot \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. associate-*r/99.7%

        \[\leadsto \left|\mathsf{fma}\left(eh, \sin t \cdot \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)\right| \]
      4. associate-*l/99.7%

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

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

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

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

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

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

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

    if -2.1e17 < t < 1.69999999999999996

    1. Initial program 100.0%

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

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

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

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

        \[\leadsto \left|\color{blue}{\mathsf{fma}\left(eh, \sin t \cdot \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. associate-*r/100.0%

        \[\leadsto \left|\mathsf{fma}\left(eh, \sin t \cdot \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)\right| \]
      4. associate-*l/100.0%

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

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

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

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

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

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

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

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

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

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

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

Alternative 9: 62.9% accurate, 2.2× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;eh \leq -9.8 \cdot 10^{+127} \lor \neg \left(eh \leq 2 \cdot 10^{+116}\right):\\
\;\;\;\;\left|eh \cdot \left(t \cdot \sin \tan^{-1} \left(\tan t \cdot \frac{eh}{-ew}\right)\right)\right|\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if eh < -9.80000000000000074e127 or 2.00000000000000003e116 < eh

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

      \[\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| \]
    8. Step-by-step derivation
      1. mul-1-neg43.7%

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

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

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

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

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

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

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

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

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

    if -9.80000000000000074e127 < eh < 2.00000000000000003e116

    1. Initial program 99.8%

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

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

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

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

        \[\leadsto \left|\color{blue}{\mathsf{fma}\left(eh, \sin t \cdot \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. associate-*r/99.8%

        \[\leadsto \left|\mathsf{fma}\left(eh, \sin t \cdot \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)\right| \]
      4. associate-*l/99.8%

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

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

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

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

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

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

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

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

Alternative 10: 60.9% 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. Add Preprocessing
  3. Step-by-step derivation
    1. sub-neg99.8%

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

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

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

      \[\leadsto \left|\color{blue}{\mathsf{fma}\left(eh, \sin t \cdot \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. associate-*r/99.8%

      \[\leadsto \left|\mathsf{fma}\left(eh, \sin t \cdot \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)\right| \]
    4. associate-*l/99.8%

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

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

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

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

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

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

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

Alternative 11: 47.8% accurate, 8.1× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.8 \cdot 10^{+20} \lor \neg \left(t \leq 2600000000000\right):\\
\;\;\;\;ew \cdot \cos t\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -1.8e20 or 2.6e12 < t

    1. Initial program 99.7%

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

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

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

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

        \[\leadsto \left|\color{blue}{\mathsf{fma}\left(eh, \sin t \cdot \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. associate-*r/99.7%

        \[\leadsto \left|\mathsf{fma}\left(eh, \sin t \cdot \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)\right| \]
      4. associate-*l/99.7%

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

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

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

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

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

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

      \[\leadsto \left|\color{blue}{ew \cdot \cos t}\right| \]
    8. Step-by-step derivation
      1. add-sqr-sqrt23.8%

        \[\leadsto \left|\color{blue}{\sqrt{ew \cdot \cos t} \cdot \sqrt{ew \cdot \cos t}}\right| \]
      2. fabs-sqr23.8%

        \[\leadsto \color{blue}{\sqrt{ew \cdot \cos t} \cdot \sqrt{ew \cdot \cos t}} \]
      3. add-sqr-sqrt24.9%

        \[\leadsto \color{blue}{ew \cdot \cos t} \]
      4. *-commutative24.9%

        \[\leadsto \color{blue}{\cos t \cdot ew} \]
    9. Applied egg-rr24.9%

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

    if -1.8e20 < t < 2.6e12

    1. Initial program 100.0%

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

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

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

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

        \[\leadsto \left|\color{blue}{\mathsf{fma}\left(eh, \sin t \cdot \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. associate-*r/100.0%

        \[\leadsto \left|\mathsf{fma}\left(eh, \sin t \cdot \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)\right| \]
      4. associate-*l/100.0%

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

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

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

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

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

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

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

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

Alternative 12: 41.8% 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. Add Preprocessing
  3. Step-by-step derivation
    1. sub-neg99.8%

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

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

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

      \[\leadsto \left|\color{blue}{\mathsf{fma}\left(eh, \sin t \cdot \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. associate-*r/99.8%

      \[\leadsto \left|\mathsf{fma}\left(eh, \sin t \cdot \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)\right| \]
    4. associate-*l/99.8%

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

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

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

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

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

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

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

Reproduce

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