Example from Robby

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

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 17 alternatives:

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

Initial Program: 99.8% accurate, 1.0× speedup?

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

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

Alternative 1: 99.8% accurate, 0.9× speedup?

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

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

    \[\left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
  2. Step-by-step derivation
    1. associate-*l*99.8%

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

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

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

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

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

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

Alternative 2: 99.8% accurate, 1.0× speedup?

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

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

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

Alternative 3: 99.8% accurate, 1.1× speedup?

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

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

    \[\left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
  2. Add Preprocessing
  3. Step-by-step derivation
    1. associate-/r*99.8%

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

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

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

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

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

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

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

Alternative 4: 98.9% accurate, 1.1× speedup?

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

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

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

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

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

Alternative 5: 98.4% accurate, 1.5× speedup?

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

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

    \[\left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
  2. Add Preprocessing
  3. Step-by-step derivation
    1. associate-/r*99.8%

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

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

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

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

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

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

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

Alternative 6: 75.1% accurate, 1.8× speedup?

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

\\
\begin{array}{l}
t_1 := \tan^{-1} \left(\frac{eh}{ew \cdot \tan t}\right)\\
\mathbf{if}\;ew \leq -1 \cdot 10^{+14} \lor \neg \left(ew \leq 1.85 \cdot 10^{+48}\right):\\
\;\;\;\;\left|\cos t\_1 \cdot \left(ew \cdot \sin t\right)\right|\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if ew < -1e14 or 1.85e48 < ew

    1. Initial program 99.8%

      \[\left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
    2. Step-by-step derivation
      1. associate-*l*99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1e14 < ew < 1.85e48

    1. Initial program 99.8%

      \[\left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
    2. Step-by-step derivation
      1. associate-*l*99.8%

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

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

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

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

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

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

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

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

Alternative 7: 75.0% accurate, 1.8× speedup?

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

\\
\begin{array}{l}
t_1 := \tan^{-1} \left(\frac{eh}{ew \cdot \tan t}\right)\\
\mathbf{if}\;ew \leq -1.05 \cdot 10^{+14} \lor \neg \left(ew \leq 6.2 \cdot 10^{+33}\right):\\
\;\;\;\;\left|ew \cdot \left(\sin t \cdot \cos t\_1\right)\right|\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if ew < -1.05e14 or 6.2e33 < ew

    1. Initial program 99.8%

      \[\left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
    2. Step-by-step derivation
      1. associate-*l*99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.05e14 < ew < 6.2e33

    1. Initial program 99.8%

      \[\left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
    2. Step-by-step derivation
      1. associate-*l*99.8%

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

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

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

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

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

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

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

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

Alternative 8: 65.9% accurate, 1.8× speedup?

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

\\
\begin{array}{l}
t_1 := \sin \tan^{-1} \left(\frac{eh}{ew \cdot \tan t}\right)\\
\mathbf{if}\;ew \leq -3.7 \cdot 10^{+40}:\\
\;\;\;\;ew \cdot \left(\sin t + eh \cdot \left(\cos t \cdot \frac{\sin \tan^{-1} \left(\frac{eh}{ew \cdot t}\right)}{ew}\right)\right)\\

\mathbf{elif}\;ew \leq 6 \cdot 10^{+52}:\\
\;\;\;\;\left|eh \cdot \left(\cos t \cdot t\_1\right)\right|\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if ew < -3.7e40

    1. Initial program 99.9%

      \[\left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
    2. Step-by-step derivation
      1. associate-*l*99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -3.7e40 < ew < 6e52

    1. Initial program 99.8%

      \[\left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
    2. Step-by-step derivation
      1. associate-*l*99.8%

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

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

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

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

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

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

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

    if 6e52 < ew

    1. Initial program 99.8%

      \[\left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
    2. Step-by-step derivation
      1. associate-*l*99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 9: 59.1% accurate, 2.2× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;ew \leq -3.1 \cdot 10^{+40} \lor \neg \left(ew \leq 3.3 \cdot 10^{+54}\right):\\
\;\;\;\;ew \cdot \left(\sin t + \frac{eh \cdot \sin \tan^{-1} \left(\frac{eh}{ew \cdot \tan t}\right)}{ew}\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if ew < -3.0999999999999998e40 or 3.3e54 < ew

    1. Initial program 99.8%

      \[\left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
    2. Step-by-step derivation
      1. associate-*l*99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -3.0999999999999998e40 < ew < 3.3e54

    1. Initial program 99.8%

      \[\left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
    2. Step-by-step derivation
      1. associate-*l*99.8%

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

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

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

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

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

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

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

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

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

Alternative 10: 58.6% accurate, 2.2× speedup?

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

\\
\begin{array}{l}
t_1 := \sin \tan^{-1} \left(\frac{eh}{ew \cdot t}\right)\\
\mathbf{if}\;ew \leq -8 \cdot 10^{-60}:\\
\;\;\;\;ew \cdot \left(\sin t + eh \cdot \left(\cos t \cdot \frac{t\_1}{ew}\right)\right)\\

\mathbf{elif}\;ew \leq 3.35 \cdot 10^{+53}:\\
\;\;\;\;\left|eh \cdot \left(\cos t \cdot t\_1\right)\right|\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if ew < -7.9999999999999998e-60

    1. Initial program 99.8%

      \[\left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
    2. Step-by-step derivation
      1. associate-*l*99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -7.9999999999999998e-60 < ew < 3.3499999999999999e53

    1. Initial program 99.8%

      \[\left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
    2. Step-by-step derivation
      1. associate-*l*99.8%

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

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

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

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

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

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

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

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

    if 3.3499999999999999e53 < ew

    1. Initial program 99.8%

      \[\left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
    2. Step-by-step derivation
      1. associate-*l*99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 11: 58.9% accurate, 2.2× speedup?

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

\\
\begin{array}{l}
t_1 := \sin \tan^{-1} \left(\frac{eh}{ew \cdot t}\right)\\
\mathbf{if}\;ew \leq -5.4 \cdot 10^{+40} \lor \neg \left(ew \leq 3.8 \cdot 10^{+50}\right):\\
\;\;\;\;ew \cdot \left(\sin t + \frac{eh \cdot t\_1}{ew}\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if ew < -5.40000000000000019e40 or 3.79999999999999987e50 < ew

    1. Initial program 99.8%

      \[\left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
    2. Step-by-step derivation
      1. associate-*l*99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -5.40000000000000019e40 < ew < 3.79999999999999987e50

    1. Initial program 99.8%

      \[\left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
    2. Step-by-step derivation
      1. associate-*l*99.8%

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

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

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

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

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

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

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

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

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

Alternative 12: 49.7% accurate, 2.2× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;ew \leq -3.35 \cdot 10^{+40} \lor \neg \left(ew \leq 6.4 \cdot 10^{+54}\right):\\
\;\;\;\;ew \cdot \left(\sin t + \frac{eh \cdot \sin \tan^{-1} \left(\frac{eh}{ew \cdot t}\right)}{ew}\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if ew < -3.35000000000000011e40 or 6.4e54 < ew

    1. Initial program 99.8%

      \[\left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
    2. Step-by-step derivation
      1. associate-*l*99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -3.35000000000000011e40 < ew < 6.4e54

    1. Initial program 99.8%

      \[\left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
    2. Step-by-step derivation
      1. associate-*l*99.8%

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

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

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

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

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

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

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

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

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

Alternative 13: 49.3% accurate, 2.8× speedup?

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

\\
\begin{array}{l}
t_1 := eh \cdot \sin \tan^{-1} \left(\frac{eh}{ew \cdot t}\right)\\
\mathbf{if}\;t \leq -80000000 \lor \neg \left(t \leq 1.85 \cdot 10^{+23}\right):\\
\;\;\;\;ew \cdot \left(\sin t + \frac{t\_1}{ew}\right)\\

\mathbf{else}:\\
\;\;\;\;\left|t\_1\right|\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -8e7 or 1.85000000000000006e23 < t

    1. Initial program 99.7%

      \[\left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
    2. Step-by-step derivation
      1. associate-*l*99.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -8e7 < t < 1.85000000000000006e23

    1. Initial program 99.9%

      \[\left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
    2. Step-by-step derivation
      1. associate-*l*99.9%

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

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

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

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

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

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

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

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

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

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

Alternative 14: 48.1% accurate, 2.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.2 \cdot 10^{+51} \lor \neg \left(t \leq 1.1 \cdot 10^{+24}\right):\\
\;\;\;\;ew \cdot \sin t\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -2.19999999999999992e51 or 1.10000000000000001e24 < t

    1. Initial program 99.7%

      \[\left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
    2. Step-by-step derivation
      1. associate-*l*99.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.19999999999999992e51 < t < 1.10000000000000001e24

    1. Initial program 99.9%

      \[\left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
    2. Step-by-step derivation
      1. associate-*l*99.9%

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

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

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

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

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

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

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

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

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

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

Alternative 15: 30.4% accurate, 4.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{eh}{ew \cdot t}\\ \mathbf{if}\;eh \leq -6.2 \cdot 10^{-101} \lor \neg \left(eh \leq 9.2 \cdot 10^{-68}\right):\\ \;\;\;\;\left|eh \cdot \frac{t\_1}{\mathsf{hypot}\left(1, t\_1\right)}\right|\\ \mathbf{else}:\\ \;\;\;\;ew \cdot \sin t\\ \end{array} \end{array} \]
(FPCore (eh ew t)
 :precision binary64
 (let* ((t_1 (/ eh (* ew t))))
   (if (or (<= eh -6.2e-101) (not (<= eh 9.2e-68)))
     (fabs (* eh (/ t_1 (hypot 1.0 t_1))))
     (* ew (sin t)))))
double code(double eh, double ew, double t) {
	double t_1 = eh / (ew * t);
	double tmp;
	if ((eh <= -6.2e-101) || !(eh <= 9.2e-68)) {
		tmp = fabs((eh * (t_1 / hypot(1.0, t_1))));
	} else {
		tmp = ew * sin(t);
	}
	return tmp;
}
public static double code(double eh, double ew, double t) {
	double t_1 = eh / (ew * t);
	double tmp;
	if ((eh <= -6.2e-101) || !(eh <= 9.2e-68)) {
		tmp = Math.abs((eh * (t_1 / Math.hypot(1.0, t_1))));
	} else {
		tmp = ew * Math.sin(t);
	}
	return tmp;
}
def code(eh, ew, t):
	t_1 = eh / (ew * t)
	tmp = 0
	if (eh <= -6.2e-101) or not (eh <= 9.2e-68):
		tmp = math.fabs((eh * (t_1 / math.hypot(1.0, t_1))))
	else:
		tmp = ew * math.sin(t)
	return tmp
function code(eh, ew, t)
	t_1 = Float64(eh / Float64(ew * t))
	tmp = 0.0
	if ((eh <= -6.2e-101) || !(eh <= 9.2e-68))
		tmp = abs(Float64(eh * Float64(t_1 / hypot(1.0, t_1))));
	else
		tmp = Float64(ew * sin(t));
	end
	return tmp
end
function tmp_2 = code(eh, ew, t)
	t_1 = eh / (ew * t);
	tmp = 0.0;
	if ((eh <= -6.2e-101) || ~((eh <= 9.2e-68)))
		tmp = abs((eh * (t_1 / hypot(1.0, t_1))));
	else
		tmp = ew * sin(t);
	end
	tmp_2 = tmp;
end
code[eh_, ew_, t_] := Block[{t$95$1 = N[(eh / N[(ew * t), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[eh, -6.2e-101], N[Not[LessEqual[eh, 9.2e-68]], $MachinePrecision]], N[Abs[N[(eh * N[(t$95$1 / N[Sqrt[1.0 ^ 2 + t$95$1 ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(ew * N[Sin[t], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \frac{eh}{ew \cdot t}\\
\mathbf{if}\;eh \leq -6.2 \cdot 10^{-101} \lor \neg \left(eh \leq 9.2 \cdot 10^{-68}\right):\\
\;\;\;\;\left|eh \cdot \frac{t\_1}{\mathsf{hypot}\left(1, t\_1\right)}\right|\\

\mathbf{else}:\\
\;\;\;\;ew \cdot \sin t\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if eh < -6.19999999999999946e-101 or 9.19999999999999987e-68 < eh

    1. Initial program 99.8%

      \[\left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
    2. Step-by-step derivation
      1. associate-*l*99.8%

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

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

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

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

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

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

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

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

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

        \[\leadsto \left|eh \cdot \color{blue}{\frac{\frac{eh}{ew \cdot t}}{\sqrt{1 + \frac{eh}{ew \cdot t} \cdot \frac{eh}{ew \cdot t}}}}\right| \]
      2. *-commutative15.2%

        \[\leadsto \left|eh \cdot \frac{\frac{eh}{\color{blue}{t \cdot ew}}}{\sqrt{1 + \frac{eh}{ew \cdot t} \cdot \frac{eh}{ew \cdot t}}}\right| \]
      3. hypot-1-def27.6%

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

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

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

    if -6.19999999999999946e-101 < eh < 9.19999999999999987e-68

    1. Initial program 99.8%

      \[\left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
    2. Step-by-step derivation
      1. associate-*l*99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto ew \cdot \color{blue}{\sin t} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification31.4%

    \[\leadsto \begin{array}{l} \mathbf{if}\;eh \leq -6.2 \cdot 10^{-101} \lor \neg \left(eh \leq 9.2 \cdot 10^{-68}\right):\\ \;\;\;\;\left|eh \cdot \frac{\frac{eh}{ew \cdot t}}{\mathsf{hypot}\left(1, \frac{eh}{ew \cdot t}\right)}\right|\\ \mathbf{else}:\\ \;\;\;\;ew \cdot \sin t\\ \end{array} \]
  5. Add Preprocessing

Alternative 16: 29.7% accurate, 4.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;eh \leq -4.5 \cdot 10^{-101} \lor \neg \left(eh \leq 9.5 \cdot 10^{-68}\right):\\ \;\;\;\;\left|eh \cdot \frac{eh}{\left(ew \cdot t\right) \cdot \mathsf{hypot}\left(1, \frac{\frac{eh}{ew}}{t}\right)}\right|\\ \mathbf{else}:\\ \;\;\;\;ew \cdot \sin t\\ \end{array} \end{array} \]
(FPCore (eh ew t)
 :precision binary64
 (if (or (<= eh -4.5e-101) (not (<= eh 9.5e-68)))
   (fabs (* eh (/ eh (* (* ew t) (hypot 1.0 (/ (/ eh ew) t))))))
   (* ew (sin t))))
double code(double eh, double ew, double t) {
	double tmp;
	if ((eh <= -4.5e-101) || !(eh <= 9.5e-68)) {
		tmp = fabs((eh * (eh / ((ew * t) * hypot(1.0, ((eh / ew) / t))))));
	} else {
		tmp = ew * sin(t);
	}
	return tmp;
}
public static double code(double eh, double ew, double t) {
	double tmp;
	if ((eh <= -4.5e-101) || !(eh <= 9.5e-68)) {
		tmp = Math.abs((eh * (eh / ((ew * t) * Math.hypot(1.0, ((eh / ew) / t))))));
	} else {
		tmp = ew * Math.sin(t);
	}
	return tmp;
}
def code(eh, ew, t):
	tmp = 0
	if (eh <= -4.5e-101) or not (eh <= 9.5e-68):
		tmp = math.fabs((eh * (eh / ((ew * t) * math.hypot(1.0, ((eh / ew) / t))))))
	else:
		tmp = ew * math.sin(t)
	return tmp
function code(eh, ew, t)
	tmp = 0.0
	if ((eh <= -4.5e-101) || !(eh <= 9.5e-68))
		tmp = abs(Float64(eh * Float64(eh / Float64(Float64(ew * t) * hypot(1.0, Float64(Float64(eh / ew) / t))))));
	else
		tmp = Float64(ew * sin(t));
	end
	return tmp
end
function tmp_2 = code(eh, ew, t)
	tmp = 0.0;
	if ((eh <= -4.5e-101) || ~((eh <= 9.5e-68)))
		tmp = abs((eh * (eh / ((ew * t) * hypot(1.0, ((eh / ew) / t))))));
	else
		tmp = ew * sin(t);
	end
	tmp_2 = tmp;
end
code[eh_, ew_, t_] := If[Or[LessEqual[eh, -4.5e-101], N[Not[LessEqual[eh, 9.5e-68]], $MachinePrecision]], N[Abs[N[(eh * N[(eh / N[(N[(ew * t), $MachinePrecision] * N[Sqrt[1.0 ^ 2 + N[(N[(eh / ew), $MachinePrecision] / t), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(ew * N[Sin[t], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;eh \leq -4.5 \cdot 10^{-101} \lor \neg \left(eh \leq 9.5 \cdot 10^{-68}\right):\\
\;\;\;\;\left|eh \cdot \frac{eh}{\left(ew \cdot t\right) \cdot \mathsf{hypot}\left(1, \frac{\frac{eh}{ew}}{t}\right)}\right|\\

\mathbf{else}:\\
\;\;\;\;ew \cdot \sin t\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if eh < -4.4999999999999998e-101 or 9.4999999999999997e-68 < eh

    1. Initial program 99.8%

      \[\left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
    2. Step-by-step derivation
      1. associate-*l*99.8%

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

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

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

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

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

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

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

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

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

        \[\leadsto \left|eh \cdot \color{blue}{\frac{\frac{eh}{ew \cdot t}}{\sqrt{1 + \frac{eh}{ew \cdot t} \cdot \frac{eh}{ew \cdot t}}}}\right| \]
      2. *-commutative15.2%

        \[\leadsto \left|eh \cdot \frac{\frac{eh}{\color{blue}{t \cdot ew}}}{\sqrt{1 + \frac{eh}{ew \cdot t} \cdot \frac{eh}{ew \cdot t}}}\right| \]
      3. hypot-1-def27.6%

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

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

      \[\leadsto \left|eh \cdot \color{blue}{\frac{\frac{eh}{t \cdot ew}}{\mathsf{hypot}\left(1, \frac{eh}{t \cdot ew}\right)}}\right| \]
    10. Step-by-step derivation
      1. associate-/l/27.8%

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

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

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

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

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

    if -4.4999999999999998e-101 < eh < 9.4999999999999997e-68

    1. Initial program 99.8%

      \[\left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
    2. Step-by-step derivation
      1. associate-*l*99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto ew \cdot \color{blue}{\sin t} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification30.5%

    \[\leadsto \begin{array}{l} \mathbf{if}\;eh \leq -4.5 \cdot 10^{-101} \lor \neg \left(eh \leq 9.5 \cdot 10^{-68}\right):\\ \;\;\;\;\left|eh \cdot \frac{eh}{\left(ew \cdot t\right) \cdot \mathsf{hypot}\left(1, \frac{\frac{eh}{ew}}{t}\right)}\right|\\ \mathbf{else}:\\ \;\;\;\;ew \cdot \sin t\\ \end{array} \]
  5. Add Preprocessing

Alternative 17: 21.7% accurate, 8.9× speedup?

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

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

    \[\left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
  2. Step-by-step derivation
    1. associate-*l*99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto ew \cdot \color{blue}{\sin t} \]
  13. Add Preprocessing

Reproduce

?
herbie shell --seed 2024131 
(FPCore (eh ew t)
  :name "Example from Robby"
  :precision binary64
  (fabs (+ (* (* ew (sin t)) (cos (atan (/ (/ eh ew) (tan t))))) (* (* eh (cos t)) (sin (atan (/ (/ eh ew) (tan t))))))))