Example 2 from Robby

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

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 12 alternatives:

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

Initial Program: 99.8% accurate, 1.0× speedup?

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

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

Alternative 1: 99.8% accurate, 1.1× speedup?

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

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

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

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

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

      \[\leadsto \left|\frac{ew \cdot \cos t}{\color{blue}{\mathsf{hypot}\left(1, \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| \]
    4. *-commutative99.8%

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

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

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

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

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

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

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

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

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

Alternative 2: 99.8% accurate, 1.1× speedup?

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

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

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

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

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

Alternative 3: 98.1% accurate, 1.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;eh \leq -1.9 \cdot 10^{+93} \lor \neg \left(eh \leq 6.5 \cdot 10^{-5}\right):\\
\;\;\;\;\left|eh \cdot \left(ew \cdot \left(\cos t \cdot \frac{1}{eh}\right) - \sin t \cdot \sin \tan^{-1} \left(\tan t \cdot \frac{eh}{-ew}\right)\right)\right|\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if eh < -1.8999999999999999e93 or 6.49999999999999943e-5 < 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. Step-by-step derivation
      1. add-sqr-sqrt47.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.8999999999999999e93 < eh < 6.49999999999999943e-5

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

Alternative 4: 97.3% accurate, 1.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;eh \leq -1.95 \cdot 10^{+174} \lor \neg \left(eh \leq 4.7 \cdot 10^{-5}\right):\\
\;\;\;\;\left|eh \cdot \left(ew \cdot \frac{\cos t}{eh} - \sin t \cdot \sin \tan^{-1} \left(\tan t \cdot \frac{eh}{-ew}\right)\right)\right|\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if eh < -1.9499999999999999e174 or 4.69999999999999972e-5 < 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. Step-by-step derivation
      1. add-sqr-sqrt49.3%

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

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

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

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

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

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

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

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

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

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

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

    if -1.9499999999999999e174 < eh < 4.69999999999999972e-5

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

Alternative 5: 94.1% accurate, 1.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;eh \leq -2 \cdot 10^{-153} \lor \neg \left(eh \leq 5.15 \cdot 10^{-132}\right):\\
\;\;\;\;\left|eh \cdot \left(ew \cdot \frac{\cos t}{eh} - \sin t \cdot \sin \tan^{-1} \left(\tan t \cdot \frac{eh}{-ew}\right)\right)\right|\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if eh < -2.00000000000000008e-153 or 5.1499999999999998e-132 < 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. Step-by-step derivation
      1. add-sqr-sqrt48.4%

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

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

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

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

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

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

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

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

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

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

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

    if -2.00000000000000008e-153 < eh < 5.1499999999999998e-132

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 74.7% accurate, 1.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;eh \leq -3.9 \cdot 10^{+55} \lor \neg \left(eh \leq 4 \cdot 10^{+36}\right):\\
\;\;\;\;\left|\left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{t \cdot \left(\left(eh \cdot {t}^{2}\right) \cdot -0.3333333333333333 - eh\right)}{ew}\right)\right|\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if eh < -3.90000000000000027e55 or 4.00000000000000017e36 < eh

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -3.90000000000000027e55 < eh < 4.00000000000000017e36

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 74.5% accurate, 1.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;eh \leq -9 \cdot 10^{+58} \lor \neg \left(eh \leq 1.3 \cdot 10^{+35}\right):\\
\;\;\;\;\left|\left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\tan t \cdot \left(-eh\right)}{ew}\right)\right|\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if eh < -8.9999999999999996e58 or 1.30000000000000003e35 < eh

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -8.9999999999999996e58 < eh < 1.30000000000000003e35

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 8: 74.6% accurate, 1.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;eh \leq -6.6 \cdot 10^{+58} \lor \neg \left(eh \leq 1.02 \cdot 10^{+37}\right):\\
\;\;\;\;\left|\left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(eh \cdot \left(-\frac{\tan t}{ew}\right)\right)\right|\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if eh < -6.59999999999999966e58 or 1.01999999999999995e37 < eh

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -6.59999999999999966e58 < eh < 1.01999999999999995e37

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 9: 74.8% accurate, 2.2× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.45 \cdot 10^{-6} \lor \neg \left(t \leq 0.14\right):\\
\;\;\;\;\left|ew \cdot \cos t\right|\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -2.44999999999999984e-6 or 0.14000000000000001 < 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. Step-by-step derivation
      1. add-sqr-sqrt47.2%

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.44999999999999984e-6 < t < 0.14000000000000001

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 10: 63.1% accurate, 2.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;eh \leq -4.7 \cdot 10^{+130} \lor \neg \left(eh \leq 3.8 \cdot 10^{+121}\right):\\
\;\;\;\;\left|eh \cdot \left(t \cdot \sin \tan^{-1} \left(eh \cdot \frac{-t}{ew}\right)\right)\right|\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if eh < -4.70000000000000045e130 or 3.8e121 < eh

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -4.70000000000000045e130 < eh < 3.8e121

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 11: 62.4% accurate, 4.5× speedup?

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

\\
\left|ew \cdot \cos t\right|
\end{array}
Derivation
  1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 12: 42.6% accurate, 9.1× speedup?

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

\\
\left|ew\right|
\end{array}
Derivation
  1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \left|ew \cdot \color{blue}{\frac{1}{\mathsf{hypot}\left(1, t \cdot \frac{eh}{-ew}\right)}}\right| \]
  11. Taylor expanded in ew around inf 42.4%

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

Reproduce

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