Example from Robby

Percentage Accurate: 99.8% → 99.8%
Time: 19.2s
Alternatives: 7
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 7 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, 1.0× speedup?

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

\\
\begin{array}{l}
t_1 := \tan^{-1} \left(\frac{eh}{\tan t \cdot ew}\right)\\
\left|\mathsf{fma}\left(\cos t \cdot \sin t\_1, eh, \left(\sin t \cdot ew\right) \cdot \cos 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. lift-+.f64N/A

      \[\leadsto \left|\color{blue}{\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. +-commutativeN/A

      \[\leadsto \left|\color{blue}{\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{\frac{eh}{ew}}{\tan t}\right)}\right| \]
    3. lift-*.f64N/A

      \[\leadsto \left|\color{blue}{\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{\frac{eh}{ew}}{\tan t}\right)\right| \]
    4. lift-*.f64N/A

      \[\leadsto \left|\color{blue}{\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{\frac{eh}{ew}}{\tan t}\right)\right| \]
    5. associate-*l*N/A

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

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

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

    \[\leadsto \left|\color{blue}{\mathsf{fma}\left(\sin \tan^{-1} \left(\frac{\frac{eh}{\tan t}}{ew}\right) \cdot \cos t, eh, \cos \tan^{-1} \left(\frac{\frac{eh}{\tan t}}{ew}\right) \cdot \left(\sin t \cdot ew\right)\right)}\right| \]
  5. Step-by-step derivation
    1. lift-/.f64N/A

      \[\leadsto \left|\mathsf{fma}\left(\sin \tan^{-1} \left(\frac{\frac{eh}{\tan t}}{ew}\right) \cdot \cos t, eh, \cos \tan^{-1} \color{blue}{\left(\frac{\frac{eh}{\tan t}}{ew}\right)} \cdot \left(\sin t \cdot ew\right)\right)\right| \]
    2. lift-/.f64N/A

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

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

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

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

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

    \[\leadsto \left|\mathsf{fma}\left(\sin \tan^{-1} \left(\frac{\frac{eh}{\tan t}}{ew}\right) \cdot \cos t, eh, \cos \tan^{-1} \color{blue}{\left(\frac{eh}{ew \cdot \tan t}\right)} \cdot \left(\sin t \cdot ew\right)\right)\right| \]
  7. Step-by-step derivation
    1. lift-/.f64N/A

      \[\leadsto \left|\mathsf{fma}\left(\sin \tan^{-1} \color{blue}{\left(\frac{\frac{eh}{\tan t}}{ew}\right)} \cdot \cos t, eh, \cos \tan^{-1} \left(\frac{eh}{ew \cdot \tan t}\right) \cdot \left(\sin t \cdot ew\right)\right)\right| \]
    2. lift-/.f64N/A

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

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

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

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

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

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

Alternative 2: 99.8% accurate, 1.1× speedup?

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

\\
\left|\mathsf{fma}\left(\cos t \cdot \sin \tan^{-1} \left(\frac{eh}{\tan t \cdot ew}\right), eh, \frac{1}{\sqrt{{\left(\frac{\frac{eh}{\tan t}}{ew}\right)}^{2} + 1}} \cdot \left(\sin t \cdot ew\right)\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. lift-+.f64N/A

      \[\leadsto \left|\color{blue}{\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. +-commutativeN/A

      \[\leadsto \left|\color{blue}{\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{\frac{eh}{ew}}{\tan t}\right)}\right| \]
    3. lift-*.f64N/A

      \[\leadsto \left|\color{blue}{\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{\frac{eh}{ew}}{\tan t}\right)\right| \]
    4. lift-*.f64N/A

      \[\leadsto \left|\color{blue}{\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{\frac{eh}{ew}}{\tan t}\right)\right| \]
    5. associate-*l*N/A

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

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

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

    \[\leadsto \left|\color{blue}{\mathsf{fma}\left(\sin \tan^{-1} \left(\frac{\frac{eh}{\tan t}}{ew}\right) \cdot \cos t, eh, \cos \tan^{-1} \left(\frac{\frac{eh}{\tan t}}{ew}\right) \cdot \left(\sin t \cdot ew\right)\right)}\right| \]
  5. Step-by-step derivation
    1. lift-/.f64N/A

      \[\leadsto \left|\mathsf{fma}\left(\sin \tan^{-1} \left(\frac{\frac{eh}{\tan t}}{ew}\right) \cdot \cos t, eh, \cos \tan^{-1} \color{blue}{\left(\frac{\frac{eh}{\tan t}}{ew}\right)} \cdot \left(\sin t \cdot ew\right)\right)\right| \]
    2. lift-/.f64N/A

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

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

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

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

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

    \[\leadsto \left|\mathsf{fma}\left(\sin \tan^{-1} \left(\frac{\frac{eh}{\tan t}}{ew}\right) \cdot \cos t, eh, \cos \tan^{-1} \color{blue}{\left(\frac{eh}{ew \cdot \tan t}\right)} \cdot \left(\sin t \cdot ew\right)\right)\right| \]
  7. Step-by-step derivation
    1. lift-/.f64N/A

      \[\leadsto \left|\mathsf{fma}\left(\sin \tan^{-1} \color{blue}{\left(\frac{\frac{eh}{\tan t}}{ew}\right)} \cdot \cos t, eh, \cos \tan^{-1} \left(\frac{eh}{ew \cdot \tan t}\right) \cdot \left(\sin t \cdot ew\right)\right)\right| \]
    2. lift-/.f64N/A

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

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

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

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

    \[\leadsto \left|\mathsf{fma}\left(\sin \tan^{-1} \color{blue}{\left(\frac{eh}{ew \cdot \tan t}\right)} \cdot \cos t, eh, \cos \tan^{-1} \left(\frac{eh}{ew \cdot \tan t}\right) \cdot \left(\sin t \cdot ew\right)\right)\right| \]
  9. Step-by-step derivation
    1. lift-cos.f64N/A

      \[\leadsto \left|\mathsf{fma}\left(\sin \tan^{-1} \left(\frac{eh}{ew \cdot \tan t}\right) \cdot \cos t, eh, \color{blue}{\cos \tan^{-1} \left(\frac{eh}{ew \cdot \tan t}\right)} \cdot \left(\sin t \cdot ew\right)\right)\right| \]
    2. lift-atan.f64N/A

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

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

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

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

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

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

      \[\leadsto \left|\mathsf{fma}\left(\sin \tan^{-1} \left(\frac{eh}{ew \cdot \tan t}\right) \cdot \cos t, eh, \color{blue}{\frac{1}{\sqrt{1 + \frac{\frac{eh}{\tan t}}{ew} \cdot \frac{\frac{eh}{\tan t}}{ew}}}} \cdot \left(\sin t \cdot ew\right)\right)\right| \]
    9. lower-/.f64N/A

      \[\leadsto \left|\mathsf{fma}\left(\sin \tan^{-1} \left(\frac{eh}{ew \cdot \tan t}\right) \cdot \cos t, eh, \color{blue}{\frac{1}{\sqrt{1 + \frac{\frac{eh}{\tan t}}{ew} \cdot \frac{\frac{eh}{\tan t}}{ew}}}} \cdot \left(\sin t \cdot ew\right)\right)\right| \]
    10. lower-sqrt.f64N/A

      \[\leadsto \left|\mathsf{fma}\left(\sin \tan^{-1} \left(\frac{eh}{ew \cdot \tan t}\right) \cdot \cos t, eh, \frac{1}{\color{blue}{\sqrt{1 + \frac{\frac{eh}{\tan t}}{ew} \cdot \frac{\frac{eh}{\tan t}}{ew}}}} \cdot \left(\sin t \cdot ew\right)\right)\right| \]
    11. +-commutativeN/A

      \[\leadsto \left|\mathsf{fma}\left(\sin \tan^{-1} \left(\frac{eh}{ew \cdot \tan t}\right) \cdot \cos t, eh, \frac{1}{\sqrt{\color{blue}{\frac{\frac{eh}{\tan t}}{ew} \cdot \frac{\frac{eh}{\tan t}}{ew} + 1}}} \cdot \left(\sin t \cdot ew\right)\right)\right| \]
    12. lower-+.f64N/A

      \[\leadsto \left|\mathsf{fma}\left(\sin \tan^{-1} \left(\frac{eh}{ew \cdot \tan t}\right) \cdot \cos t, eh, \frac{1}{\sqrt{\color{blue}{\frac{\frac{eh}{\tan t}}{ew} \cdot \frac{\frac{eh}{\tan t}}{ew} + 1}}} \cdot \left(\sin t \cdot ew\right)\right)\right| \]
    13. pow2N/A

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

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

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

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

Alternative 3: 91.1% accurate, 1.1× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if ew < -1.35000000000000003e-166 or 6.0000000000000004e-206 < ew

    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. Add Preprocessing
    3. Taylor expanded in t around 0

      \[\leadsto \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} \color{blue}{\left(\frac{eh}{ew \cdot t}\right)}\right| \]
    4. Step-by-step derivation
      1. lower-/.f64N/A

        \[\leadsto \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} \color{blue}{\left(\frac{eh}{ew \cdot t}\right)}\right| \]
      2. lower-*.f6494.6

        \[\leadsto \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{eh}{\color{blue}{ew \cdot t}}\right)\right| \]
    5. Applied rewrites94.6%

      \[\leadsto \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} \color{blue}{\left(\frac{eh}{ew \cdot t}\right)}\right| \]

    if -1.35000000000000003e-166 < ew < 6.0000000000000004e-206

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

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

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

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

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

        \[\leadsto \left|\color{blue}{\sin \tan^{-1} \left(\frac{eh \cdot \cos t}{ew \cdot \sin t}\right)} \cdot \left(eh \cdot \cos t\right)\right| \]
      5. lower-atan.f64N/A

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

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

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

        \[\leadsto \left|\sin \tan^{-1} \color{blue}{\left(\frac{eh}{ew \cdot \sin t} \cdot \cos t\right)} \cdot \left(eh \cdot \cos t\right)\right| \]
      9. lower-*.f64N/A

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

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

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

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

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

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

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

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

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

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

Alternative 4: 75.0% accurate, 1.6× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if ew < -2.9e20 or 1.55e99 < 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. Add Preprocessing
    3. Taylor expanded in ew around inf

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

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

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

        \[\leadsto \left|\cos \tan^{-1} \left(\frac{eh \cdot \cos t}{ew \cdot \sin t}\right) \cdot \color{blue}{\left(ew \cdot \sin t\right)}\right| \]
      4. lower-*.f64N/A

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

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

    if -2.9e20 < ew < 1.55e99

    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. Add Preprocessing
    3. Step-by-step derivation
      1. lift-+.f64N/A

        \[\leadsto \left|\color{blue}{\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. +-commutativeN/A

        \[\leadsto \left|\color{blue}{\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{\frac{eh}{ew}}{\tan t}\right)}\right| \]
      3. lift-*.f64N/A

        \[\leadsto \left|\color{blue}{\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{\frac{eh}{ew}}{\tan t}\right)\right| \]
      4. lift-*.f64N/A

        \[\leadsto \left|\color{blue}{\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{\frac{eh}{ew}}{\tan t}\right)\right| \]
      5. associate-*l*N/A

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

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

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

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

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

        \[\leadsto \left|\color{blue}{\left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{eh \cdot \cos t}{ew \cdot \sin t}\right)}\right| \]
      2. lower-*.f64N/A

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

        \[\leadsto \left|\color{blue}{\left(\cos t \cdot eh\right)} \cdot \sin \tan^{-1} \left(\frac{eh \cdot \cos t}{ew \cdot \sin t}\right)\right| \]
      4. lower-*.f64N/A

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

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

        \[\leadsto \left|\left(\cos t \cdot eh\right) \cdot \color{blue}{\sin \tan^{-1} \left(\frac{eh \cdot \cos t}{ew \cdot \sin t}\right)}\right| \]
      7. lower-atan.f64N/A

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

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

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

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

        \[\leadsto \left|\left(\cos t \cdot eh\right) \cdot \sin \tan^{-1} \left(\frac{\frac{\color{blue}{\cos t \cdot eh}}{ew}}{\sin t}\right)\right| \]
      12. lower-*.f64N/A

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

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

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

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

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

Alternative 5: 75.0% accurate, 1.6× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if ew < -2.9e20 or 1.55e99 < 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. Add Preprocessing
    3. Taylor expanded in ew around inf

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

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

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

        \[\leadsto \left|\cos \tan^{-1} \left(\frac{eh \cdot \cos t}{ew \cdot \sin t}\right) \cdot \color{blue}{\left(ew \cdot \sin t\right)}\right| \]
      4. lower-*.f64N/A

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

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

    if -2.9e20 < ew < 1.55e99

    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. Add Preprocessing
    3. Taylor expanded in ew around 0

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

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

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

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

        \[\leadsto \left|\color{blue}{\sin \tan^{-1} \left(\frac{eh \cdot \cos t}{ew \cdot \sin t}\right)} \cdot \left(eh \cdot \cos t\right)\right| \]
      5. lower-atan.f64N/A

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

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

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

        \[\leadsto \left|\sin \tan^{-1} \color{blue}{\left(\frac{eh}{ew \cdot \sin t} \cdot \cos t\right)} \cdot \left(eh \cdot \cos t\right)\right| \]
      9. lower-*.f64N/A

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

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

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

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

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

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

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

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

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

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

Alternative 6: 58.9% accurate, 1.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \left|\cos \tan^{-1} \left(\frac{\frac{eh}{\sin t}}{ew} \cdot \cos t\right) \cdot \left(\sin t \cdot ew\right)\right|\\ \mathbf{if}\;ew \leq -2.8 \cdot 10^{+20}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;ew \leq 3.25 \cdot 10^{+94}:\\ \;\;\;\;\left|\mathsf{fma}\left(\frac{-0.5}{eh}, \frac{\left(ew \cdot ew\right) \cdot {\sin t}^{2}}{{\cos t}^{2}}, eh\right)\right|\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (eh ew t)
 :precision binary64
 (let* ((t_1
         (fabs
          (* (cos (atan (* (/ (/ eh (sin t)) ew) (cos t)))) (* (sin t) ew)))))
   (if (<= ew -2.8e+20)
     t_1
     (if (<= ew 3.25e+94)
       (fabs
        (fma
         (/ -0.5 eh)
         (/ (* (* ew ew) (pow (sin t) 2.0)) (pow (cos t) 2.0))
         eh))
       t_1))))
double code(double eh, double ew, double t) {
	double t_1 = fabs((cos(atan((((eh / sin(t)) / ew) * cos(t)))) * (sin(t) * ew)));
	double tmp;
	if (ew <= -2.8e+20) {
		tmp = t_1;
	} else if (ew <= 3.25e+94) {
		tmp = fabs(fma((-0.5 / eh), (((ew * ew) * pow(sin(t), 2.0)) / pow(cos(t), 2.0)), eh));
	} else {
		tmp = t_1;
	}
	return tmp;
}
function code(eh, ew, t)
	t_1 = abs(Float64(cos(atan(Float64(Float64(Float64(eh / sin(t)) / ew) * cos(t)))) * Float64(sin(t) * ew)))
	tmp = 0.0
	if (ew <= -2.8e+20)
		tmp = t_1;
	elseif (ew <= 3.25e+94)
		tmp = abs(fma(Float64(-0.5 / eh), Float64(Float64(Float64(ew * ew) * (sin(t) ^ 2.0)) / (cos(t) ^ 2.0)), eh));
	else
		tmp = t_1;
	end
	return tmp
end
code[eh_, ew_, t_] := Block[{t$95$1 = N[Abs[N[(N[Cos[N[ArcTan[N[(N[(N[(eh / N[Sin[t], $MachinePrecision]), $MachinePrecision] / ew), $MachinePrecision] * N[Cos[t], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * N[(N[Sin[t], $MachinePrecision] * ew), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[ew, -2.8e+20], t$95$1, If[LessEqual[ew, 3.25e+94], N[Abs[N[(N[(-0.5 / eh), $MachinePrecision] * N[(N[(N[(ew * ew), $MachinePrecision] * N[Power[N[Sin[t], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / N[Power[N[Cos[t], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] + eh), $MachinePrecision]], $MachinePrecision], t$95$1]]]
\begin{array}{l}

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

\mathbf{elif}\;ew \leq 3.25 \cdot 10^{+94}:\\
\;\;\;\;\left|\mathsf{fma}\left(\frac{-0.5}{eh}, \frac{\left(ew \cdot ew\right) \cdot {\sin t}^{2}}{{\cos t}^{2}}, eh\right)\right|\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if ew < -2.8e20 or 3.24999999999999988e94 < 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. Add Preprocessing
    3. Taylor expanded in ew around inf

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

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

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

        \[\leadsto \left|\cos \tan^{-1} \left(\frac{eh \cdot \cos t}{ew \cdot \sin t}\right) \cdot \color{blue}{\left(ew \cdot \sin t\right)}\right| \]
      4. lower-*.f64N/A

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

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

    if -2.8e20 < ew < 3.24999999999999988e94

    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. Add Preprocessing
    3. Taylor expanded in t around 0

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

        \[\leadsto \left|\color{blue}{\sin \tan^{-1} \left(\frac{eh \cdot \cos t}{ew \cdot \sin t}\right) \cdot eh}\right| \]
      2. lower-*.f64N/A

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

        \[\leadsto \left|\color{blue}{\sin \tan^{-1} \left(\frac{eh \cdot \cos t}{ew \cdot \sin t}\right)} \cdot eh\right| \]
      4. lower-atan.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \left|\sin \tan^{-1} \left(\frac{eh}{ew \cdot t}\right) \cdot eh\right| \]
    7. Step-by-step derivation
      1. Applied rewrites54.9%

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

          \[\leadsto \left|\frac{\frac{\frac{eh}{ew}}{t}}{\sqrt{{\left(\frac{\frac{eh}{ew}}{t}\right)}^{2} + 1}} \cdot eh\right| \]
        2. Taylor expanded in ew around 0

          \[\leadsto \left|eh + \color{blue}{\frac{-1}{2} \cdot \frac{{ew}^{2} \cdot {\sin t}^{2}}{eh \cdot {\cos t}^{2}}}\right| \]
        3. Step-by-step derivation
          1. Applied rewrites56.5%

            \[\leadsto \left|\mathsf{fma}\left(\frac{-0.5}{eh}, \color{blue}{\frac{{\sin t}^{2} \cdot \left(ew \cdot ew\right)}{{\cos t}^{2}}}, eh\right)\right| \]
        4. Recombined 2 regimes into one program.
        5. Final simplification65.0%

          \[\leadsto \begin{array}{l} \mathbf{if}\;ew \leq -2.8 \cdot 10^{+20}:\\ \;\;\;\;\left|\cos \tan^{-1} \left(\frac{\frac{eh}{\sin t}}{ew} \cdot \cos t\right) \cdot \left(\sin t \cdot ew\right)\right|\\ \mathbf{elif}\;ew \leq 3.25 \cdot 10^{+94}:\\ \;\;\;\;\left|\mathsf{fma}\left(\frac{-0.5}{eh}, \frac{\left(ew \cdot ew\right) \cdot {\sin t}^{2}}{{\cos t}^{2}}, eh\right)\right|\\ \mathbf{else}:\\ \;\;\;\;\left|\cos \tan^{-1} \left(\frac{\frac{eh}{\sin t}}{ew} \cdot \cos t\right) \cdot \left(\sin t \cdot ew\right)\right|\\ \end{array} \]
        6. Add Preprocessing

        Alternative 7: 42.2% accurate, 174.0× speedup?

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

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

            \[\leadsto \left|\color{blue}{\sin \tan^{-1} \left(\frac{eh \cdot \cos t}{ew \cdot \sin t}\right) \cdot eh}\right| \]
          2. lower-*.f64N/A

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

            \[\leadsto \left|\color{blue}{\sin \tan^{-1} \left(\frac{eh \cdot \cos t}{ew \cdot \sin t}\right)} \cdot eh\right| \]
          4. lower-atan.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \left|\sin \tan^{-1} \left(\frac{eh}{ew \cdot t}\right) \cdot eh\right| \]
        7. Step-by-step derivation
          1. Applied rewrites41.0%

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

              \[\leadsto \left|\frac{\frac{\frac{eh}{ew}}{t}}{\sqrt{{\left(\frac{\frac{eh}{ew}}{t}\right)}^{2} + 1}} \cdot eh\right| \]
            2. Taylor expanded in eh around -inf

              \[\leadsto \left|-1 \cdot \color{blue}{eh}\right| \]
            3. Step-by-step derivation
              1. Applied rewrites42.8%

                \[\leadsto \left|-eh\right| \]
              2. Add Preprocessing

              Reproduce

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