Example 2 from Robby

Percentage Accurate: 99.8% → 99.8%
Time: 19.9s
Alternatives: 14
Speedup: 1.0×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 14 alternatives:

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

Initial Program: 99.8% accurate, 1.0× speedup?

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

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

Alternative 1: 99.8% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
t_1 := eh \cdot \tan t\\
\left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{t\_1}{ew}\right) - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{t\_1}{-ew}\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. add-sqr-sqrt46.8%

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

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

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

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

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

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

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

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

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

Alternative 2: 88.1% accurate, 0.7× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (-.f64 (*.f64 (*.f64 ew (cos.f64 t)) (cos.f64 (atan.f64 (/.f64 (*.f64 (neg.f64 eh) (tan.f64 t)) ew)))) (*.f64 (*.f64 eh (sin.f64 t)) (sin.f64 (atan.f64 (/.f64 (*.f64 (neg.f64 eh) (tan.f64 t)) ew))))) < -4.99999999999999982e-272

    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. 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| \]
      2. associate-*l*99.8%

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

        \[\leadsto \left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) + \color{blue}{eh \cdot \left(-\sin t \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right)}\right| \]
      4. cancel-sign-sub99.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(-eh\right) \cdot \left(-\sin t \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right)}\right| \]
      5. associate-/l*99.8%

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

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

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

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

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

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

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

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

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

        \[\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)} - eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right)\right)\right| \]
      9. sqr-neg94.6%

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

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

        \[\leadsto \left|\frac{ew \cdot \cos t}{\mathsf{hypot}\left(1, \tan t \cdot \frac{\color{blue}{eh}}{ew}\right)} - eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right)\right)\right| \]
    6. 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(\left(-eh\right) \cdot \frac{\tan t}{ew}\right)\right)\right| \]
    7. Taylor expanded in t around 0 75.2%

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

    if -4.99999999999999982e-272 < (-.f64 (*.f64 (*.f64 ew (cos.f64 t)) (cos.f64 (atan.f64 (/.f64 (*.f64 (neg.f64 eh) (tan.f64 t)) ew)))) (*.f64 (*.f64 eh (sin.f64 t)) (sin.f64 (atan.f64 (/.f64 (*.f64 (neg.f64 eh) (tan.f64 t)) ew)))))

    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. 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| \]
      2. associate-*l*99.8%

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

        \[\leadsto \left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) + \color{blue}{eh \cdot \left(-\sin t \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right)}\right| \]
      4. cancel-sign-sub99.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(-eh\right) \cdot \left(-\sin t \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right)}\right| \]
      5. associate-/l*99.8%

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

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

      \[\leadsto \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)} \]
    6. Taylor expanded in ew around inf 98.2%

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

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

Alternative 3: 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)} - eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(eh \cdot \frac{\tan t}{-ew}\right)\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 (* eh (/ (tan t) (- 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((eh * (tan(t) / -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((eh * (Math.tan(t) / -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((eh * (math.tan(t) / -ew))))))))
function code(eh, ew, t)
	return abs(Float64(Float64(Float64(ew * cos(t)) / hypot(1.0, Float64(tan(t) * Float64(eh / ew)))) - Float64(eh * Float64(sin(t) * sin(atan(Float64(eh * Float64(tan(t) / Float64(-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((eh * (tan(t) / -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[(eh * N[(N[Sin[t], $MachinePrecision] * N[Sin[N[ArcTan[N[(eh * N[(N[Tan[t], $MachinePrecision] / (-ew)), $MachinePrecision]), $MachinePrecision]], $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)} - eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(eh \cdot \frac{\tan t}{-ew}\right)\right)\right|
\end{array}
Derivation
  1. Initial program 99.8%

    \[\left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right| \]
  2. 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| \]
    2. associate-*l*99.8%

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

      \[\leadsto \left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) + \color{blue}{eh \cdot \left(-\sin t \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right)}\right| \]
    4. cancel-sign-sub99.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(-eh\right) \cdot \left(-\sin t \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right)}\right| \]
    5. associate-/l*99.8%

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

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

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

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

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

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

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

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

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

      \[\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)} - eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right)\right)\right| \]
    9. sqr-neg93.0%

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

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

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

    \[\leadsto \left|\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(eh \cdot \frac{\tan t}{-ew}\right)\right)\right| \]
  8. Add Preprocessing

Alternative 4: 99.8% accurate, 1.1× speedup?

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

\\
\left|\frac{ew}{\frac{\mathsf{hypot}\left(1, eh \cdot \frac{\tan t}{ew}\right)}{\cos t}} - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{eh \cdot \tan t}{-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. add-sqr-sqrt46.8%

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

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

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

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

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

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

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

    \[\leadsto \left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\color{blue}{eh \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| \]
  7. Step-by-step derivation
    1. associate-*l*99.8%

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

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

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

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

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

      \[\leadsto \left|ew \cdot \color{blue}{\frac{\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| \]
    7. clear-num99.8%

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

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

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

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

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

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

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

Alternative 5: 98.6% accurate, 1.5× speedup?

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

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

    \[\left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right| \]
  2. 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| \]
    2. associate-*l*99.8%

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

      \[\leadsto \left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) + \color{blue}{eh \cdot \left(-\sin t \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right)}\right| \]
    4. cancel-sign-sub99.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(-eh\right) \cdot \left(-\sin t \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right)}\right| \]
    5. associate-/l*99.8%

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

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

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

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

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

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

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

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

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

      \[\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)} - eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right)\right)\right| \]
    9. sqr-neg93.0%

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

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

      \[\leadsto \left|\frac{ew \cdot \cos t}{\mathsf{hypot}\left(1, \tan t \cdot \frac{\color{blue}{eh}}{ew}\right)} - eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right)\right)\right| \]
  6. 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(\left(-eh\right) \cdot \frac{\tan t}{ew}\right)\right)\right| \]
  7. Taylor expanded in ew around inf 97.3%

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

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

Alternative 6: 87.5% accurate, 1.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;ew \leq -9.5 \cdot 10^{+89} \lor \neg \left(ew \leq 1.38 \cdot 10^{+54}\right):\\
\;\;\;\;\left|ew \cdot \cos t\right|\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if ew < -9.5000000000000003e89 or 1.38e54 < ew

    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-sqrt43.4%

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

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

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

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

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

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

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

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

      \[\leadsto \left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\color{blue}{eh \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| \]
    7. Step-by-step derivation
      1. associate-*l*99.8%

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

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

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

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

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

        \[\leadsto \left|ew \cdot \color{blue}{\frac{\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| \]
      7. clear-num99.7%

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

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

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

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

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

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

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

    if -9.5000000000000003e89 < ew < 1.38e54

    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. 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| \]
      2. associate-*l*99.8%

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

        \[\leadsto \left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) + \color{blue}{eh \cdot \left(-\sin t \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right)}\right| \]
      4. cancel-sign-sub99.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(-eh\right) \cdot \left(-\sin t \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right)}\right| \]
      5. associate-/l*99.8%

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

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

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

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

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

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

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

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

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

        \[\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)} - eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right)\right)\right| \]
      9. sqr-neg98.3%

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

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

        \[\leadsto \left|\frac{ew \cdot \cos t}{\mathsf{hypot}\left(1, \tan t \cdot \frac{\color{blue}{eh}}{ew}\right)} - eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right)\right)\right| \]
    6. 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(\left(-eh\right) \cdot \frac{\tan t}{ew}\right)\right)\right| \]
    7. Taylor expanded in t around 0 82.6%

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

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

Alternative 7: 73.9% accurate, 1.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;eh \leq -1.66 \cdot 10^{+162} \lor \neg \left(eh \leq 1.85 \cdot 10^{+71}\right):\\ \;\;\;\;\left|eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(eh \cdot \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 -1.66e+162) (not (<= eh 1.85e+71)))
   (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 <= -1.66e+162) || !(eh <= 1.85e+71)) {
		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 <= (-1.66d+162)) .or. (.not. (eh <= 1.85d+71))) 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 <= -1.66e+162) || !(eh <= 1.85e+71)) {
		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 <= -1.66e+162) or not (eh <= 1.85e+71):
		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 <= -1.66e+162) || !(eh <= 1.85e+71))
		tmp = abs(Float64(eh * Float64(sin(t) * sin(atan(Float64(eh * Float64(tan(t) / 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 <= -1.66e+162) || ~((eh <= 1.85e+71)))
		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, -1.66e+162], N[Not[LessEqual[eh, 1.85e+71]], $MachinePrecision]], N[Abs[N[(eh * N[(N[Sin[t], $MachinePrecision] * N[Sin[N[ArcTan[N[(eh * N[(N[Tan[t], $MachinePrecision] / (-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 -1.66 \cdot 10^{+162} \lor \neg \left(eh \leq 1.85 \cdot 10^{+71}\right):\\
\;\;\;\;\left|eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(eh \cdot \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 < -1.66000000000000003e162 or 1.85e71 < 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. 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| \]
      2. associate-*l*99.8%

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

        \[\leadsto \left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) + \color{blue}{eh \cdot \left(-\sin t \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right)}\right| \]
      4. cancel-sign-sub99.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(-eh\right) \cdot \left(-\sin t \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right)}\right| \]
      5. associate-/l*99.8%

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

      \[\leadsto \color{blue}{\left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right) - eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right)\right)\right|} \]
    4. Add Preprocessing
    5. Taylor expanded in ew around 0 76.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| \]
    6. Step-by-step derivation
      1. associate-*r*76.2%

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

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

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

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

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

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

    if -1.66000000000000003e162 < eh < 1.85e71

    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-sqrt50.7%

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

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

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

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

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

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

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

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

      \[\leadsto \left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\color{blue}{eh \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| \]
    7. Step-by-step derivation
      1. associate-*l*99.9%

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

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

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

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

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

        \[\leadsto \left|ew \cdot \color{blue}{\frac{\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| \]
      7. clear-num99.8%

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

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

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

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

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

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

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

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

Alternative 8: 73.9% accurate, 1.8× speedup?

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

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

\mathbf{elif}\;eh \leq 3.5 \cdot 10^{+74}:\\
\;\;\;\;\left|ew \cdot \cos t\right|\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if eh < -1.40000000000000007e163

    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. 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| \]
      2. associate-*l*99.8%

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

        \[\leadsto \left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) + \color{blue}{eh \cdot \left(-\sin t \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right)}\right| \]
      4. cancel-sign-sub99.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(-eh\right) \cdot \left(-\sin t \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right)}\right| \]
      5. associate-/l*99.8%

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

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

      \[\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| \]
    6. Step-by-step derivation
      1. associate-*r*79.4%

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

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

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

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

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

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

    if -1.40000000000000007e163 < eh < 3.50000000000000014e74

    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-sqrt50.7%

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

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

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

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

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

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

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

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

      \[\leadsto \left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\color{blue}{eh \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| \]
    7. Step-by-step derivation
      1. associate-*l*99.9%

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

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

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

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

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

        \[\leadsto \left|ew \cdot \color{blue}{\frac{\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| \]
      7. clear-num99.8%

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

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

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

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

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

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

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

    if 3.50000000000000014e74 < eh

    1. Initial program 99.7%

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

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

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

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

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

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

      \[\leadsto \color{blue}{\left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right) - eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right)\right)\right|} \]
    4. Add Preprocessing
    5. Taylor expanded in ew around 0 74.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| \]
    6. Step-by-step derivation
      1. mul-1-neg74.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*74.3%

        \[\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-in74.3%

        \[\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. distribute-rgt-neg-in74.3%

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

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

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

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

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

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

Alternative 9: 74.9% accurate, 2.2× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -5 or 7.7999999999999999e-5 < t

    1. Initial program 99.7%

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

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

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

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

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

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

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

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

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

      \[\leadsto \left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\color{blue}{eh \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| \]
    7. Step-by-step derivation
      1. associate-*l*99.7%

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

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

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

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

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

        \[\leadsto \left|ew \cdot \color{blue}{\frac{\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| \]
      7. clear-num99.5%

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

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

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

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

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

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

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

    if -5 < t < 7.7999999999999999e-5

    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-sqrt43.1%

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

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

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

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

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

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

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

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

      \[\leadsto \left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\color{blue}{eh \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| \]
    7. Step-by-step derivation
      1. associate-*l*100.0%

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

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

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

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

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

        \[\leadsto \left|ew \cdot \color{blue}{\frac{\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| \]
      7. clear-num100.0%

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

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

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

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

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

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

      \[\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| \]
    10. Step-by-step derivation
      1. mul-1-neg97.3%

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

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

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

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

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

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

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

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

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

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

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

Alternative 10: 66.6% accurate, 2.2× speedup?

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if ew < -7.6000000000000002e-118 or 1.5e-157 < ew

    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-sqrt46.7%

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

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

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

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

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

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

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

      \[\leadsto \left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\color{blue}{eh \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| \]
    7. Step-by-step derivation
      1. associate-*l*99.8%

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

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

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

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

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

        \[\leadsto \left|ew \cdot \color{blue}{\frac{\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| \]
      7. clear-num99.7%

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

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

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

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

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

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

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

    if -7.6000000000000002e-118 < ew < 3.9000000000000002e-230

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

        \[\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| \]
      2. associate-*l*99.9%

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

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

        \[\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(-eh\right) \cdot \left(-\sin t \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right)}\right| \]
      5. associate-/l*99.9%

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

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

      \[\leadsto \color{blue}{{\left(\sqrt[3]{\mathsf{fma}\left(ew, \frac{\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)}\right)}^{3}} \]
    6. Taylor expanded in ew around 0 20.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 3.9000000000000002e-230 < ew < 1.5e-157

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

        \[\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| \]
      2. associate-*l*99.9%

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

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

        \[\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(-eh\right) \cdot \left(-\sin t \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right)}\right| \]
      5. associate-/l*99.9%

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

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

      \[\leadsto \color{blue}{{\left(\sqrt[3]{\mathsf{fma}\left(ew, \frac{\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)}\right)}^{3}} \]
    6. Taylor expanded in t around 0 87.0%

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

Alternative 11: 63.8% accurate, 2.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;eh \leq 3.4 \cdot 10^{+163}:\\
\;\;\;\;\left|ew \cdot \cos t\right|\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if eh < 3.4000000000000001e163

    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-sqrt53.2%

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

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

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

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

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

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

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

      \[\leadsto \left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\color{blue}{eh \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| \]
    7. Step-by-step derivation
      1. associate-*l*99.8%

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

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

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

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

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

        \[\leadsto \left|ew \cdot \color{blue}{\frac{\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| \]
      7. clear-num99.8%

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

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

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

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

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

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

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

    if 3.4000000000000001e163 < eh

    1. Initial program 99.7%

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{{\left(\sqrt[3]{\mathsf{fma}\left(ew, \frac{\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)}\right)}^{3}} \]
    6. Taylor expanded in ew around 0 39.6%

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

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

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

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

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

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

Alternative 12: 62.1% 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-sqrt46.8%

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

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

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

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

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

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

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

    \[\leadsto \left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\color{blue}{eh \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| \]
  7. Step-by-step derivation
    1. associate-*l*99.8%

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

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

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

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

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

      \[\leadsto \left|ew \cdot \color{blue}{\frac{\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| \]
    7. clear-num99.8%

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

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

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

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

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

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

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

Alternative 13: 43.0% accurate, 9.1× speedup?

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\color{blue}{eh \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| \]
  7. Step-by-step derivation
    1. associate-*l*99.8%

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

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

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

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

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

      \[\leadsto \left|ew \cdot \color{blue}{\frac{\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| \]
    7. clear-num99.8%

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

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

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

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

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

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

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

Alternative 14: 22.2% accurate, 921.0× speedup?

\[\begin{array}{l} \\ ew \end{array} \]
(FPCore (eh ew t) :precision binary64 ew)
double code(double eh, double ew, double t) {
	return ew;
}
real(8) function code(eh, ew, t)
    real(8), intent (in) :: eh
    real(8), intent (in) :: ew
    real(8), intent (in) :: t
    code = ew
end function
public static double code(double eh, double ew, double t) {
	return ew;
}
def code(eh, ew, t):
	return ew
function code(eh, ew, t)
	return ew
end
function tmp = code(eh, ew, t)
	tmp = ew;
end
code[eh_, ew_, t_] := ew
\begin{array}{l}

\\
ew
\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. 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| \]
    2. associate-*l*99.8%

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

      \[\leadsto \left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) + \color{blue}{eh \cdot \left(-\sin t \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right)}\right| \]
    4. cancel-sign-sub99.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(-eh\right) \cdot \left(-\sin t \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right)}\right| \]
    5. associate-/l*99.8%

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

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

    \[\leadsto \color{blue}{{\left(\sqrt[3]{\mathsf{fma}\left(ew, \frac{\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)}\right)}^{3}} \]
  6. Taylor expanded in t around 0 23.2%

    \[\leadsto {\color{blue}{\left(\sqrt[3]{ew}\right)}}^{3} \]
  7. Step-by-step derivation
    1. rem-cube-cbrt23.5%

      \[\leadsto \color{blue}{ew} \]
    2. *-un-lft-identity23.5%

      \[\leadsto \color{blue}{1 \cdot ew} \]
  8. Applied egg-rr23.5%

    \[\leadsto \color{blue}{1 \cdot ew} \]
  9. Final simplification23.5%

    \[\leadsto ew \]
  10. Add Preprocessing

Reproduce

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