Example 2 from Robby

Percentage Accurate: 99.8% → 99.8%
Time: 12.7s
Alternatives: 9
Speedup: 1.0×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 9 alternatives:

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

Initial Program: 99.8% accurate, 1.0× speedup?

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

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

Alternative 1: 99.8% accurate, 1.0× speedup?

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

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

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

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

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

Alternative 2: 99.0% accurate, 1.1× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 75.2% accurate, 1.3× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if eh < -2.54999999999999992e119 or 2e147 < eh

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      if -2.54999999999999992e119 < eh < 2e147

      1. Initial program 99.8%

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

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

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

    Alternative 4: 81.0% accurate, 1.3× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} t_1 := eh \cdot \frac{\tan t}{ew}\\ \mathbf{if}\;eh \leq 1.32 \cdot 10^{+149}:\\ \;\;\;\;\left|\frac{\left(\sin t \cdot eh\right) \cdot t\_1 + \cos t \cdot ew}{\frac{1}{{\left(1 + {t\_1}^{2}\right)}^{-0.5}}}\right|\\ \mathbf{else}:\\ \;\;\;\;\left|\sin \tan^{-1} \left(\frac{t}{-ew} \cdot eh\right) \cdot \left(\left(-eh\right) \cdot \sin t\right)\right|\\ \end{array} \end{array} \]
    (FPCore (eh ew t)
     :precision binary64
     (let* ((t_1 (* eh (/ (tan t) ew))))
       (if (<= eh 1.32e+149)
         (fabs
          (/
           (+ (* (* (sin t) eh) t_1) (* (cos t) ew))
           (/ 1.0 (pow (+ 1.0 (pow t_1 2.0)) -0.5))))
         (fabs (* (sin (atan (* (/ t (- ew)) eh))) (* (- eh) (sin t)))))))
    double code(double eh, double ew, double t) {
    	double t_1 = eh * (tan(t) / ew);
    	double tmp;
    	if (eh <= 1.32e+149) {
    		tmp = fabs(((((sin(t) * eh) * t_1) + (cos(t) * ew)) / (1.0 / pow((1.0 + pow(t_1, 2.0)), -0.5))));
    	} else {
    		tmp = fabs((sin(atan(((t / -ew) * eh))) * (-eh * sin(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) :: t_1
        real(8) :: tmp
        t_1 = eh * (tan(t) / ew)
        if (eh <= 1.32d+149) then
            tmp = abs(((((sin(t) * eh) * t_1) + (cos(t) * ew)) / (1.0d0 / ((1.0d0 + (t_1 ** 2.0d0)) ** (-0.5d0)))))
        else
            tmp = abs((sin(atan(((t / -ew) * eh))) * (-eh * sin(t))))
        end if
        code = tmp
    end function
    
    public static double code(double eh, double ew, double t) {
    	double t_1 = eh * (Math.tan(t) / ew);
    	double tmp;
    	if (eh <= 1.32e+149) {
    		tmp = Math.abs(((((Math.sin(t) * eh) * t_1) + (Math.cos(t) * ew)) / (1.0 / Math.pow((1.0 + Math.pow(t_1, 2.0)), -0.5))));
    	} else {
    		tmp = Math.abs((Math.sin(Math.atan(((t / -ew) * eh))) * (-eh * Math.sin(t))));
    	}
    	return tmp;
    }
    
    def code(eh, ew, t):
    	t_1 = eh * (math.tan(t) / ew)
    	tmp = 0
    	if eh <= 1.32e+149:
    		tmp = math.fabs(((((math.sin(t) * eh) * t_1) + (math.cos(t) * ew)) / (1.0 / math.pow((1.0 + math.pow(t_1, 2.0)), -0.5))))
    	else:
    		tmp = math.fabs((math.sin(math.atan(((t / -ew) * eh))) * (-eh * math.sin(t))))
    	return tmp
    
    function code(eh, ew, t)
    	t_1 = Float64(eh * Float64(tan(t) / ew))
    	tmp = 0.0
    	if (eh <= 1.32e+149)
    		tmp = abs(Float64(Float64(Float64(Float64(sin(t) * eh) * t_1) + Float64(cos(t) * ew)) / Float64(1.0 / (Float64(1.0 + (t_1 ^ 2.0)) ^ -0.5))));
    	else
    		tmp = abs(Float64(sin(atan(Float64(Float64(t / Float64(-ew)) * eh))) * Float64(Float64(-eh) * sin(t))));
    	end
    	return tmp
    end
    
    function tmp_2 = code(eh, ew, t)
    	t_1 = eh * (tan(t) / ew);
    	tmp = 0.0;
    	if (eh <= 1.32e+149)
    		tmp = abs(((((sin(t) * eh) * t_1) + (cos(t) * ew)) / (1.0 / ((1.0 + (t_1 ^ 2.0)) ^ -0.5))));
    	else
    		tmp = abs((sin(atan(((t / -ew) * eh))) * (-eh * sin(t))));
    	end
    	tmp_2 = tmp;
    end
    
    code[eh_, ew_, t_] := Block[{t$95$1 = N[(eh * N[(N[Tan[t], $MachinePrecision] / ew), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[eh, 1.32e+149], N[Abs[N[(N[(N[(N[(N[Sin[t], $MachinePrecision] * eh), $MachinePrecision] * t$95$1), $MachinePrecision] + N[(N[Cos[t], $MachinePrecision] * ew), $MachinePrecision]), $MachinePrecision] / N[(1.0 / N[Power[N[(1.0 + N[Power[t$95$1, 2.0], $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Abs[N[(N[Sin[N[ArcTan[N[(N[(t / (-ew)), $MachinePrecision] * eh), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * N[((-eh) * N[Sin[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    t_1 := eh \cdot \frac{\tan t}{ew}\\
    \mathbf{if}\;eh \leq 1.32 \cdot 10^{+149}:\\
    \;\;\;\;\left|\frac{\left(\sin t \cdot eh\right) \cdot t\_1 + \cos t \cdot ew}{\frac{1}{{\left(1 + {t\_1}^{2}\right)}^{-0.5}}}\right|\\
    
    \mathbf{else}:\\
    \;\;\;\;\left|\sin \tan^{-1} \left(\frac{t}{-ew} \cdot eh\right) \cdot \left(\left(-eh\right) \cdot \sin t\right)\right|\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if eh < 1.32000000000000004e149

      1. Initial program 99.8%

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

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

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

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

          \[\leadsto \left|\frac{\left(\sin t \cdot \left(-eh\right)\right) \cdot \left(\frac{\tan t}{ew} \cdot eh\right) - \cos t \cdot ew}{\frac{1}{\color{blue}{\frac{1}{\sqrt{1 + \left(\frac{\tan t}{ew} \cdot eh\right) \cdot \left(\frac{\tan t}{ew} \cdot eh\right)}}}}}\right| \]
        4. pow1/2N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      if 1.32000000000000004e149 < eh

      1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \left|\left(\left(-eh\right) \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\left(-eh\right) \cdot \frac{t}{ew}\right)\right| \]
      8. Recombined 2 regimes into one program.
      9. Final simplification87.6%

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

      Alternative 5: 75.2% accurate, 1.3× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(-eh\right) \cdot \sin t\\ t_2 := \left|\sin \tan^{-1} \left(\frac{t}{-ew} \cdot eh\right) \cdot t\_1\right|\\ t_3 := eh \cdot \frac{\tan t}{ew}\\ \mathbf{if}\;eh \leq -2.55 \cdot 10^{+119}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;eh \leq 2 \cdot 10^{+147}:\\ \;\;\;\;\left|\mathsf{fma}\left(-ew, \cos t, t\_3 \cdot t\_1\right) \cdot \cos \tan^{-1} t\_3\right|\\ \mathbf{else}:\\ \;\;\;\;t\_2\\ \end{array} \end{array} \]
      (FPCore (eh ew t)
       :precision binary64
       (let* ((t_1 (* (- eh) (sin t)))
              (t_2 (fabs (* (sin (atan (* (/ t (- ew)) eh))) t_1)))
              (t_3 (* eh (/ (tan t) ew))))
         (if (<= eh -2.55e+119)
           t_2
           (if (<= eh 2e+147)
             (fabs (* (fma (- ew) (cos t) (* t_3 t_1)) (cos (atan t_3))))
             t_2))))
      double code(double eh, double ew, double t) {
      	double t_1 = -eh * sin(t);
      	double t_2 = fabs((sin(atan(((t / -ew) * eh))) * t_1));
      	double t_3 = eh * (tan(t) / ew);
      	double tmp;
      	if (eh <= -2.55e+119) {
      		tmp = t_2;
      	} else if (eh <= 2e+147) {
      		tmp = fabs((fma(-ew, cos(t), (t_3 * t_1)) * cos(atan(t_3))));
      	} else {
      		tmp = t_2;
      	}
      	return tmp;
      }
      
      function code(eh, ew, t)
      	t_1 = Float64(Float64(-eh) * sin(t))
      	t_2 = abs(Float64(sin(atan(Float64(Float64(t / Float64(-ew)) * eh))) * t_1))
      	t_3 = Float64(eh * Float64(tan(t) / ew))
      	tmp = 0.0
      	if (eh <= -2.55e+119)
      		tmp = t_2;
      	elseif (eh <= 2e+147)
      		tmp = abs(Float64(fma(Float64(-ew), cos(t), Float64(t_3 * t_1)) * cos(atan(t_3))));
      	else
      		tmp = t_2;
      	end
      	return tmp
      end
      
      code[eh_, ew_, t_] := Block[{t$95$1 = N[((-eh) * N[Sin[t], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Abs[N[(N[Sin[N[ArcTan[N[(N[(t / (-ew)), $MachinePrecision] * eh), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * t$95$1), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[(eh * N[(N[Tan[t], $MachinePrecision] / ew), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[eh, -2.55e+119], t$95$2, If[LessEqual[eh, 2e+147], N[Abs[N[(N[((-ew) * N[Cos[t], $MachinePrecision] + N[(t$95$3 * t$95$1), $MachinePrecision]), $MachinePrecision] * N[Cos[N[ArcTan[t$95$3], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], t$95$2]]]]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      t_1 := \left(-eh\right) \cdot \sin t\\
      t_2 := \left|\sin \tan^{-1} \left(\frac{t}{-ew} \cdot eh\right) \cdot t\_1\right|\\
      t_3 := eh \cdot \frac{\tan t}{ew}\\
      \mathbf{if}\;eh \leq -2.55 \cdot 10^{+119}:\\
      \;\;\;\;t\_2\\
      
      \mathbf{elif}\;eh \leq 2 \cdot 10^{+147}:\\
      \;\;\;\;\left|\mathsf{fma}\left(-ew, \cos t, t\_3 \cdot t\_1\right) \cdot \cos \tan^{-1} t\_3\right|\\
      
      \mathbf{else}:\\
      \;\;\;\;t\_2\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if eh < -2.54999999999999992e119 or 2e147 < eh

        1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          if -2.54999999999999992e119 < eh < 2e147

          1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            \[\leadsto \color{blue}{\left|\mathsf{fma}\left(-ew, \cos t, \left(\left(-eh\right) \cdot \sin t\right) \cdot \left(eh \cdot \frac{\tan t}{ew}\right)\right) \cdot \cos \tan^{-1} \left(eh \cdot \frac{\tan t}{ew}\right)\right|} \]
        8. Recombined 2 regimes into one program.
        9. Final simplification81.5%

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

        Alternative 6: 73.9% accurate, 1.9× speedup?

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

          1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            if -2.54999999999999992e119 < eh < 8.5e146

            1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

          Alternative 7: 66.2% accurate, 2.4× speedup?

          \[\begin{array}{l} \\ \begin{array}{l} t_1 := \left|\sin \tan^{-1} \left(\frac{t}{-ew} \cdot eh\right) \cdot \left(\left(-eh\right) \cdot \sin t\right)\right|\\ \mathbf{if}\;eh \leq -2.55 \cdot 10^{+119}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;eh \leq 8.5 \cdot 10^{+146}:\\ \;\;\;\;\left|\frac{\left(-ew\right) \cdot \cos t}{\frac{-1}{\cos \tan^{-1} \left(\frac{eh}{ew} \cdot t\right)}}\right|\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
          (FPCore (eh ew t)
           :precision binary64
           (let* ((t_1 (fabs (* (sin (atan (* (/ t (- ew)) eh))) (* (- eh) (sin t))))))
             (if (<= eh -2.55e+119)
               t_1
               (if (<= eh 8.5e+146)
                 (fabs (/ (* (- ew) (cos t)) (/ -1.0 (cos (atan (* (/ eh ew) t))))))
                 t_1))))
          double code(double eh, double ew, double t) {
          	double t_1 = fabs((sin(atan(((t / -ew) * eh))) * (-eh * sin(t))));
          	double tmp;
          	if (eh <= -2.55e+119) {
          		tmp = t_1;
          	} else if (eh <= 8.5e+146) {
          		tmp = fabs(((-ew * cos(t)) / (-1.0 / cos(atan(((eh / ew) * t))))));
          	} else {
          		tmp = t_1;
          	}
          	return tmp;
          }
          
          real(8) function code(eh, ew, t)
              real(8), intent (in) :: eh
              real(8), intent (in) :: ew
              real(8), intent (in) :: t
              real(8) :: t_1
              real(8) :: tmp
              t_1 = abs((sin(atan(((t / -ew) * eh))) * (-eh * sin(t))))
              if (eh <= (-2.55d+119)) then
                  tmp = t_1
              else if (eh <= 8.5d+146) then
                  tmp = abs(((-ew * cos(t)) / ((-1.0d0) / cos(atan(((eh / ew) * t))))))
              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.sin(Math.atan(((t / -ew) * eh))) * (-eh * Math.sin(t))));
          	double tmp;
          	if (eh <= -2.55e+119) {
          		tmp = t_1;
          	} else if (eh <= 8.5e+146) {
          		tmp = Math.abs(((-ew * Math.cos(t)) / (-1.0 / Math.cos(Math.atan(((eh / ew) * t))))));
          	} else {
          		tmp = t_1;
          	}
          	return tmp;
          }
          
          def code(eh, ew, t):
          	t_1 = math.fabs((math.sin(math.atan(((t / -ew) * eh))) * (-eh * math.sin(t))))
          	tmp = 0
          	if eh <= -2.55e+119:
          		tmp = t_1
          	elif eh <= 8.5e+146:
          		tmp = math.fabs(((-ew * math.cos(t)) / (-1.0 / math.cos(math.atan(((eh / ew) * t))))))
          	else:
          		tmp = t_1
          	return tmp
          
          function code(eh, ew, t)
          	t_1 = abs(Float64(sin(atan(Float64(Float64(t / Float64(-ew)) * eh))) * Float64(Float64(-eh) * sin(t))))
          	tmp = 0.0
          	if (eh <= -2.55e+119)
          		tmp = t_1;
          	elseif (eh <= 8.5e+146)
          		tmp = abs(Float64(Float64(Float64(-ew) * cos(t)) / Float64(-1.0 / cos(atan(Float64(Float64(eh / ew) * t))))));
          	else
          		tmp = t_1;
          	end
          	return tmp
          end
          
          function tmp_2 = code(eh, ew, t)
          	t_1 = abs((sin(atan(((t / -ew) * eh))) * (-eh * sin(t))));
          	tmp = 0.0;
          	if (eh <= -2.55e+119)
          		tmp = t_1;
          	elseif (eh <= 8.5e+146)
          		tmp = abs(((-ew * cos(t)) / (-1.0 / cos(atan(((eh / ew) * t))))));
          	else
          		tmp = t_1;
          	end
          	tmp_2 = tmp;
          end
          
          code[eh_, ew_, t_] := Block[{t$95$1 = N[Abs[N[(N[Sin[N[ArcTan[N[(N[(t / (-ew)), $MachinePrecision] * eh), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * N[((-eh) * N[Sin[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[eh, -2.55e+119], t$95$1, If[LessEqual[eh, 8.5e+146], N[Abs[N[(N[((-ew) * N[Cos[t], $MachinePrecision]), $MachinePrecision] / N[(-1.0 / N[Cos[N[ArcTan[N[(N[(eh / ew), $MachinePrecision] * t), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], t$95$1]]]
          
          \begin{array}{l}
          
          \\
          \begin{array}{l}
          t_1 := \left|\sin \tan^{-1} \left(\frac{t}{-ew} \cdot eh\right) \cdot \left(\left(-eh\right) \cdot \sin t\right)\right|\\
          \mathbf{if}\;eh \leq -2.55 \cdot 10^{+119}:\\
          \;\;\;\;t\_1\\
          
          \mathbf{elif}\;eh \leq 8.5 \cdot 10^{+146}:\\
          \;\;\;\;\left|\frac{\left(-ew\right) \cdot \cos t}{\frac{-1}{\cos \tan^{-1} \left(\frac{eh}{ew} \cdot t\right)}}\right|\\
          
          \mathbf{else}:\\
          \;\;\;\;t\_1\\
          
          
          \end{array}
          \end{array}
          
          Derivation
          1. Split input into 2 regimes
          2. if eh < -2.54999999999999992e119 or 8.5e146 < eh

            1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

              if -2.54999999999999992e119 < eh < 8.5e146

              1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            Alternative 8: 62.1% accurate, 2.5× speedup?

            \[\begin{array}{l} \\ \begin{array}{l} t_1 := \left|\sin \tan^{-1} \left(\frac{t}{-ew} \cdot eh\right) \cdot \left(\left(-eh\right) \cdot \sin t\right)\right|\\ \mathbf{if}\;t \leq -8.8 \cdot 10^{-10}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t \leq 2.5 \cdot 10^{-18}:\\ \;\;\;\;\left|\frac{ew}{1}\right|\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
            (FPCore (eh ew t)
             :precision binary64
             (let* ((t_1 (fabs (* (sin (atan (* (/ t (- ew)) eh))) (* (- eh) (sin t))))))
               (if (<= t -8.8e-10) t_1 (if (<= t 2.5e-18) (fabs (/ ew 1.0)) t_1))))
            double code(double eh, double ew, double t) {
            	double t_1 = fabs((sin(atan(((t / -ew) * eh))) * (-eh * sin(t))));
            	double tmp;
            	if (t <= -8.8e-10) {
            		tmp = t_1;
            	} else if (t <= 2.5e-18) {
            		tmp = fabs((ew / 1.0));
            	} else {
            		tmp = t_1;
            	}
            	return tmp;
            }
            
            real(8) function code(eh, ew, t)
                real(8), intent (in) :: eh
                real(8), intent (in) :: ew
                real(8), intent (in) :: t
                real(8) :: t_1
                real(8) :: tmp
                t_1 = abs((sin(atan(((t / -ew) * eh))) * (-eh * sin(t))))
                if (t <= (-8.8d-10)) then
                    tmp = t_1
                else if (t <= 2.5d-18) then
                    tmp = abs((ew / 1.0d0))
                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.sin(Math.atan(((t / -ew) * eh))) * (-eh * Math.sin(t))));
            	double tmp;
            	if (t <= -8.8e-10) {
            		tmp = t_1;
            	} else if (t <= 2.5e-18) {
            		tmp = Math.abs((ew / 1.0));
            	} else {
            		tmp = t_1;
            	}
            	return tmp;
            }
            
            def code(eh, ew, t):
            	t_1 = math.fabs((math.sin(math.atan(((t / -ew) * eh))) * (-eh * math.sin(t))))
            	tmp = 0
            	if t <= -8.8e-10:
            		tmp = t_1
            	elif t <= 2.5e-18:
            		tmp = math.fabs((ew / 1.0))
            	else:
            		tmp = t_1
            	return tmp
            
            function code(eh, ew, t)
            	t_1 = abs(Float64(sin(atan(Float64(Float64(t / Float64(-ew)) * eh))) * Float64(Float64(-eh) * sin(t))))
            	tmp = 0.0
            	if (t <= -8.8e-10)
            		tmp = t_1;
            	elseif (t <= 2.5e-18)
            		tmp = abs(Float64(ew / 1.0));
            	else
            		tmp = t_1;
            	end
            	return tmp
            end
            
            function tmp_2 = code(eh, ew, t)
            	t_1 = abs((sin(atan(((t / -ew) * eh))) * (-eh * sin(t))));
            	tmp = 0.0;
            	if (t <= -8.8e-10)
            		tmp = t_1;
            	elseif (t <= 2.5e-18)
            		tmp = abs((ew / 1.0));
            	else
            		tmp = t_1;
            	end
            	tmp_2 = tmp;
            end
            
            code[eh_, ew_, t_] := Block[{t$95$1 = N[Abs[N[(N[Sin[N[ArcTan[N[(N[(t / (-ew)), $MachinePrecision] * eh), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * N[((-eh) * N[Sin[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t, -8.8e-10], t$95$1, If[LessEqual[t, 2.5e-18], N[Abs[N[(ew / 1.0), $MachinePrecision]], $MachinePrecision], t$95$1]]]
            
            \begin{array}{l}
            
            \\
            \begin{array}{l}
            t_1 := \left|\sin \tan^{-1} \left(\frac{t}{-ew} \cdot eh\right) \cdot \left(\left(-eh\right) \cdot \sin t\right)\right|\\
            \mathbf{if}\;t \leq -8.8 \cdot 10^{-10}:\\
            \;\;\;\;t\_1\\
            
            \mathbf{elif}\;t \leq 2.5 \cdot 10^{-18}:\\
            \;\;\;\;\left|\frac{ew}{1}\right|\\
            
            \mathbf{else}:\\
            \;\;\;\;t\_1\\
            
            
            \end{array}
            \end{array}
            
            Derivation
            1. Split input into 2 regimes
            2. if t < -8.7999999999999996e-10 or 2.50000000000000018e-18 < t

              1. Initial program 99.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                if -8.7999999999999996e-10 < t < 2.50000000000000018e-18

                1. Initial program 100.0%

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

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

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

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

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

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

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

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

                      \[\leadsto \left|\frac{ew}{1}\right| \]
                    3. Step-by-step derivation
                      1. Applied rewrites79.9%

                        \[\leadsto \left|\frac{ew}{1}\right| \]
                    4. Recombined 2 regimes into one program.
                    5. Final simplification63.6%

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

                    Alternative 9: 42.2% accurate, 61.6× speedup?

                    \[\begin{array}{l} \\ \left|\frac{ew}{1}\right| \end{array} \]
                    (FPCore (eh ew t) :precision binary64 (fabs (/ ew 1.0)))
                    double code(double eh, double ew, double t) {
                    	return fabs((ew / 1.0));
                    }
                    
                    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 / 1.0d0))
                    end function
                    
                    public static double code(double eh, double ew, double t) {
                    	return Math.abs((ew / 1.0));
                    }
                    
                    def code(eh, ew, t):
                    	return math.fabs((ew / 1.0))
                    
                    function code(eh, ew, t)
                    	return abs(Float64(ew / 1.0))
                    end
                    
                    function tmp = code(eh, ew, t)
                    	tmp = abs((ew / 1.0));
                    end
                    
                    code[eh_, ew_, t_] := N[Abs[N[(ew / 1.0), $MachinePrecision]], $MachinePrecision]
                    
                    \begin{array}{l}
                    
                    \\
                    \left|\frac{ew}{1}\right|
                    \end{array}
                    
                    Derivation
                    1. Initial program 99.8%

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

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

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

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

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

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

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

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

                          \[\leadsto \left|\frac{ew}{1}\right| \]
                        3. Step-by-step derivation
                          1. Applied rewrites47.4%

                            \[\leadsto \left|\frac{ew}{1}\right| \]
                          2. Add Preprocessing

                          Reproduce

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