Example 2 from Robby

Percentage Accurate: 99.8% → 99.8%
Time: 19.2s
Alternatives: 11
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 11 alternatives:

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

Initial Program: 99.8% accurate, 1.0× speedup?

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

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

Alternative 1: 99.8% accurate, 1.0× speedup?

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

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

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

Alternative 2: 99.8% accurate, 1.1× speedup?

\[\begin{array}{l} \\ \left|\frac{1}{\mathsf{hypot}\left(1, \tan t \cdot \frac{eh}{ew}\right)} \cdot \left(ew \cdot \cos t\right) - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{eh \cdot \left(-\tan t\right)}{ew}\right)\right| \end{array} \]
(FPCore (eh ew t)
 :precision binary64
 (fabs
  (-
   (* (/ 1.0 (hypot 1.0 (* (tan t) (/ eh ew)))) (* ew (cos t)))
   (* (* eh (sin t)) (sin (atan (/ (* eh (- (tan t))) ew)))))))
double code(double eh, double ew, double t) {
	return fabs((((1.0 / hypot(1.0, (tan(t) * (eh / ew)))) * (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((((1.0 / Math.hypot(1.0, (Math.tan(t) * (eh / ew)))) * (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((((1.0 / math.hypot(1.0, (math.tan(t) * (eh / ew)))) * (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(Float64(1.0 / hypot(1.0, Float64(tan(t) * Float64(eh / ew)))) * Float64(ew * cos(t))) - Float64(Float64(eh * sin(t)) * sin(atan(Float64(Float64(eh * Float64(-tan(t))) / ew))))))
end
function tmp = code(eh, ew, t)
	tmp = abs((((1.0 / hypot(1.0, (tan(t) * (eh / ew)))) * (ew * cos(t))) - ((eh * sin(t)) * sin(atan(((eh * -tan(t)) / ew))))));
end
code[eh_, ew_, t_] := N[Abs[N[(N[(N[(1.0 / N[Sqrt[1.0 ^ 2 + N[(N[Tan[t], $MachinePrecision] * N[(eh / ew), $MachinePrecision]), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision] * N[(ew * 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{1}{\mathsf{hypot}\left(1, \tan t \cdot \frac{eh}{ew}\right)} \cdot \left(ew \cdot \cos t\right) - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{eh \cdot \left(-\tan t\right)}{ew}\right)\right|
\end{array}
Derivation
  1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 99.0% accurate, 1.1× speedup?

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

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

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

    \[\leadsto \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{\color{blue}{-1 \cdot \left(eh \cdot t\right)}}{ew}\right)\right| \]
  4. Step-by-step derivation
    1. mul-1-neg99.1%

      \[\leadsto \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{\color{blue}{-eh \cdot t}}{ew}\right)\right| \]
    2. distribute-rgt-neg-in99.1%

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

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

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

Alternative 4: 99.0% accurate, 1.3× speedup?

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

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

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

    \[\leadsto \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{\color{blue}{-1 \cdot \left(eh \cdot t\right)}}{ew}\right)\right| \]
  4. Step-by-step derivation
    1. mul-1-neg99.1%

      \[\leadsto \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{\color{blue}{-eh \cdot t}}{ew}\right)\right| \]
    2. distribute-rgt-neg-in99.1%

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

    \[\leadsto \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{\color{blue}{eh \cdot \left(-t\right)}}{ew}\right)\right| \]
  6. Step-by-step derivation
    1. associate-*r/99.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 98.6% accurate, 1.5× speedup?

\[\begin{array}{l} \\ \left|ew \cdot \cos t - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{eh \cdot \left(-\tan t\right)}{ew}\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(Float64(eh * sin(t)) * sin(atan(Float64(Float64(eh * Float64(-tan(t))) / 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[(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|ew \cdot \cos t - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{eh \cdot \left(-\tan t\right)}{ew}\right)\right|
\end{array}
Derivation
  1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 91.6% accurate, 1.8× speedup?

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

\\
\begin{array}{l}
t_1 := eh \cdot \frac{t}{ew}\\
t_2 := eh \cdot \sin t\\
\mathbf{if}\;ew \leq -9.2 \cdot 10^{-61} \lor \neg \left(ew \leq 6.1 \cdot 10^{-83}\right):\\
\;\;\;\;\left|t\_2 \cdot \frac{t\_1}{\mathsf{hypot}\left(1, t\_1\right)} - ew \cdot \cos t\right|\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if ew < -9.19999999999999967e-61 or 6.10000000000000003e-83 < 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. Taylor expanded in t around 0 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(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\color{blue}{-1 \cdot \left(eh \cdot t\right)}}{ew}\right)\right| \]
    4. Step-by-step derivation
      1. mul-1-neg99.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left|\left(ew \cdot \cos t\right) \cdot 1 - \left(eh \cdot \sin t\right) \cdot \color{blue}{\frac{\frac{eh \cdot \left(-t\right)}{ew}}{\sqrt{1 + \frac{eh \cdot \left(-t\right)}{ew} \cdot \frac{eh \cdot \left(-t\right)}{ew}}}}\right| \]
      2. associate-*r/85.9%

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

        \[\leadsto \left|\left(ew \cdot \cos t\right) \cdot 1 - \frac{\left(eh \cdot \sin t\right) \cdot \frac{\color{blue}{-eh \cdot t}}{ew}}{\sqrt{1 + \frac{eh \cdot \left(-t\right)}{ew} \cdot \frac{eh \cdot \left(-t\right)}{ew}}}\right| \]
      4. distribute-lft-neg-in85.9%

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

        \[\leadsto \left|\left(ew \cdot \cos t\right) \cdot 1 - \frac{\left(eh \cdot \sin t\right) \cdot \color{blue}{\left(\left(-eh\right) \cdot \frac{t}{ew}\right)}}{\sqrt{1 + \frac{eh \cdot \left(-t\right)}{ew} \cdot \frac{eh \cdot \left(-t\right)}{ew}}}\right| \]
      6. clear-num86.4%

        \[\leadsto \left|\left(ew \cdot \cos t\right) \cdot 1 - \frac{\left(eh \cdot \sin t\right) \cdot \left(\left(-eh\right) \cdot \color{blue}{\frac{1}{\frac{ew}{t}}}\right)}{\sqrt{1 + \frac{eh \cdot \left(-t\right)}{ew} \cdot \frac{eh \cdot \left(-t\right)}{ew}}}\right| \]
      7. add-sqr-sqrt31.4%

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

        \[\leadsto \left|\left(ew \cdot \cos t\right) \cdot 1 - \frac{\left(eh \cdot \sin t\right) \cdot \left(\color{blue}{\sqrt{\left(-eh\right) \cdot \left(-eh\right)}} \cdot \frac{1}{\frac{ew}{t}}\right)}{\sqrt{1 + \frac{eh \cdot \left(-t\right)}{ew} \cdot \frac{eh \cdot \left(-t\right)}{ew}}}\right| \]
      9. sqr-neg74.4%

        \[\leadsto \left|\left(ew \cdot \cos t\right) \cdot 1 - \frac{\left(eh \cdot \sin t\right) \cdot \left(\sqrt{\color{blue}{eh \cdot eh}} \cdot \frac{1}{\frac{ew}{t}}\right)}{\sqrt{1 + \frac{eh \cdot \left(-t\right)}{ew} \cdot \frac{eh \cdot \left(-t\right)}{ew}}}\right| \]
      10. sqrt-unprod55.0%

        \[\leadsto \left|\left(ew \cdot \cos t\right) \cdot 1 - \frac{\left(eh \cdot \sin t\right) \cdot \left(\color{blue}{\left(\sqrt{eh} \cdot \sqrt{eh}\right)} \cdot \frac{1}{\frac{ew}{t}}\right)}{\sqrt{1 + \frac{eh \cdot \left(-t\right)}{ew} \cdot \frac{eh \cdot \left(-t\right)}{ew}}}\right| \]
      11. add-sqr-sqrt86.4%

        \[\leadsto \left|\left(ew \cdot \cos t\right) \cdot 1 - \frac{\left(eh \cdot \sin t\right) \cdot \left(\color{blue}{eh} \cdot \frac{1}{\frac{ew}{t}}\right)}{\sqrt{1 + \frac{eh \cdot \left(-t\right)}{ew} \cdot \frac{eh \cdot \left(-t\right)}{ew}}}\right| \]
      12. un-div-inv86.4%

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

        \[\leadsto \left|\left(ew \cdot \cos t\right) \cdot 1 - \frac{\left(eh \cdot \sin t\right) \cdot \frac{eh}{\frac{ew}{t}}}{\color{blue}{\mathsf{hypot}\left(1, \frac{eh \cdot \left(-t\right)}{ew}\right)}}\right| \]
      14. distribute-rgt-neg-out87.0%

        \[\leadsto \left|\left(ew \cdot \cos t\right) \cdot 1 - \frac{\left(eh \cdot \sin t\right) \cdot \frac{eh}{\frac{ew}{t}}}{\mathsf{hypot}\left(1, \frac{\color{blue}{-eh \cdot t}}{ew}\right)}\right| \]
      15. distribute-lft-neg-in87.0%

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

        \[\leadsto \left|\left(ew \cdot \cos t\right) \cdot 1 - \frac{\left(eh \cdot \sin t\right) \cdot \frac{eh}{\frac{ew}{t}}}{\mathsf{hypot}\left(1, \color{blue}{\left(-eh\right) \cdot \frac{t}{ew}}\right)}\right| \]
      17. clear-num87.2%

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

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

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

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

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

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

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

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

        \[\leadsto \left|\left(ew \cdot \cos t\right) \cdot 1 - \left(eh \cdot \sin t\right) \cdot \frac{eh \cdot \frac{t}{ew}}{\mathsf{hypot}\left(1, \color{blue}{eh \cdot \frac{t}{ew}}\right)}\right| \]
    12. Simplified93.1%

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

    if -9.19999999999999967e-61 < ew < 6.10000000000000003e-83

    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. associate-*r/98.0%

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \left|\color{blue}{ew} \cdot \frac{1}{\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| \]
    6. Taylor expanded in t around 0 91.8%

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

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

Alternative 7: 98.3% accurate, 1.8× speedup?

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

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

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

    \[\leadsto \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{\color{blue}{-1 \cdot \left(eh \cdot t\right)}}{ew}\right)\right| \]
  4. Step-by-step derivation
    1. mul-1-neg99.1%

      \[\leadsto \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{\color{blue}{-eh \cdot t}}{ew}\right)\right| \]
    2. distribute-rgt-neg-in99.1%

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

    \[\leadsto \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{\color{blue}{eh \cdot \left(-t\right)}}{ew}\right)\right| \]
  6. Step-by-step derivation
    1. associate-*r/99.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 8: 91.6% accurate, 2.1× speedup?

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

\\
\begin{array}{l}
t_1 := eh \cdot \frac{t}{ew}\\
t_2 := eh \cdot \sin t\\
\mathbf{if}\;ew \leq -1.62 \cdot 10^{-59} \lor \neg \left(ew \leq 1.06 \cdot 10^{-85}\right):\\
\;\;\;\;\left|t\_2 \cdot \frac{t\_1}{\mathsf{hypot}\left(1, t\_1\right)} - ew \cdot \cos t\right|\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if ew < -1.61999999999999989e-59 or 1.0599999999999999e-85 < 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. Taylor expanded in t around 0 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(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\color{blue}{-1 \cdot \left(eh \cdot t\right)}}{ew}\right)\right| \]
    4. Step-by-step derivation
      1. mul-1-neg99.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left|\left(ew \cdot \cos t\right) \cdot 1 - \left(eh \cdot \sin t\right) \cdot \color{blue}{\frac{\frac{eh \cdot \left(-t\right)}{ew}}{\sqrt{1 + \frac{eh \cdot \left(-t\right)}{ew} \cdot \frac{eh \cdot \left(-t\right)}{ew}}}}\right| \]
      2. associate-*r/85.9%

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

        \[\leadsto \left|\left(ew \cdot \cos t\right) \cdot 1 - \frac{\left(eh \cdot \sin t\right) \cdot \frac{\color{blue}{-eh \cdot t}}{ew}}{\sqrt{1 + \frac{eh \cdot \left(-t\right)}{ew} \cdot \frac{eh \cdot \left(-t\right)}{ew}}}\right| \]
      4. distribute-lft-neg-in85.9%

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

        \[\leadsto \left|\left(ew \cdot \cos t\right) \cdot 1 - \frac{\left(eh \cdot \sin t\right) \cdot \color{blue}{\left(\left(-eh\right) \cdot \frac{t}{ew}\right)}}{\sqrt{1 + \frac{eh \cdot \left(-t\right)}{ew} \cdot \frac{eh \cdot \left(-t\right)}{ew}}}\right| \]
      6. clear-num86.4%

        \[\leadsto \left|\left(ew \cdot \cos t\right) \cdot 1 - \frac{\left(eh \cdot \sin t\right) \cdot \left(\left(-eh\right) \cdot \color{blue}{\frac{1}{\frac{ew}{t}}}\right)}{\sqrt{1 + \frac{eh \cdot \left(-t\right)}{ew} \cdot \frac{eh \cdot \left(-t\right)}{ew}}}\right| \]
      7. add-sqr-sqrt31.4%

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

        \[\leadsto \left|\left(ew \cdot \cos t\right) \cdot 1 - \frac{\left(eh \cdot \sin t\right) \cdot \left(\color{blue}{\sqrt{\left(-eh\right) \cdot \left(-eh\right)}} \cdot \frac{1}{\frac{ew}{t}}\right)}{\sqrt{1 + \frac{eh \cdot \left(-t\right)}{ew} \cdot \frac{eh \cdot \left(-t\right)}{ew}}}\right| \]
      9. sqr-neg74.4%

        \[\leadsto \left|\left(ew \cdot \cos t\right) \cdot 1 - \frac{\left(eh \cdot \sin t\right) \cdot \left(\sqrt{\color{blue}{eh \cdot eh}} \cdot \frac{1}{\frac{ew}{t}}\right)}{\sqrt{1 + \frac{eh \cdot \left(-t\right)}{ew} \cdot \frac{eh \cdot \left(-t\right)}{ew}}}\right| \]
      10. sqrt-unprod55.0%

        \[\leadsto \left|\left(ew \cdot \cos t\right) \cdot 1 - \frac{\left(eh \cdot \sin t\right) \cdot \left(\color{blue}{\left(\sqrt{eh} \cdot \sqrt{eh}\right)} \cdot \frac{1}{\frac{ew}{t}}\right)}{\sqrt{1 + \frac{eh \cdot \left(-t\right)}{ew} \cdot \frac{eh \cdot \left(-t\right)}{ew}}}\right| \]
      11. add-sqr-sqrt86.4%

        \[\leadsto \left|\left(ew \cdot \cos t\right) \cdot 1 - \frac{\left(eh \cdot \sin t\right) \cdot \left(\color{blue}{eh} \cdot \frac{1}{\frac{ew}{t}}\right)}{\sqrt{1 + \frac{eh \cdot \left(-t\right)}{ew} \cdot \frac{eh \cdot \left(-t\right)}{ew}}}\right| \]
      12. un-div-inv86.4%

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

        \[\leadsto \left|\left(ew \cdot \cos t\right) \cdot 1 - \frac{\left(eh \cdot \sin t\right) \cdot \frac{eh}{\frac{ew}{t}}}{\color{blue}{\mathsf{hypot}\left(1, \frac{eh \cdot \left(-t\right)}{ew}\right)}}\right| \]
      14. distribute-rgt-neg-out87.0%

        \[\leadsto \left|\left(ew \cdot \cos t\right) \cdot 1 - \frac{\left(eh \cdot \sin t\right) \cdot \frac{eh}{\frac{ew}{t}}}{\mathsf{hypot}\left(1, \frac{\color{blue}{-eh \cdot t}}{ew}\right)}\right| \]
      15. distribute-lft-neg-in87.0%

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

        \[\leadsto \left|\left(ew \cdot \cos t\right) \cdot 1 - \frac{\left(eh \cdot \sin t\right) \cdot \frac{eh}{\frac{ew}{t}}}{\mathsf{hypot}\left(1, \color{blue}{\left(-eh\right) \cdot \frac{t}{ew}}\right)}\right| \]
      17. clear-num87.2%

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

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

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

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

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

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

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

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

        \[\leadsto \left|\left(ew \cdot \cos t\right) \cdot 1 - \left(eh \cdot \sin t\right) \cdot \frac{eh \cdot \frac{t}{ew}}{\mathsf{hypot}\left(1, \color{blue}{eh \cdot \frac{t}{ew}}\right)}\right| \]
    12. Simplified93.1%

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

    if -1.61999999999999989e-59 < ew < 1.0599999999999999e-85

    1. Initial program 99.8%

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

      \[\leadsto \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{\color{blue}{-1 \cdot \left(eh \cdot t\right)}}{ew}\right)\right| \]
    4. Step-by-step derivation
      1. mul-1-neg98.0%

        \[\leadsto \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{\color{blue}{-eh \cdot t}}{ew}\right)\right| \]
      2. distribute-rgt-neg-in98.0%

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

      \[\leadsto \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{\color{blue}{eh \cdot \left(-t\right)}}{ew}\right)\right| \]
    6. Step-by-step derivation
      1. associate-*r/98.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 9: 85.7% accurate, 2.2× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;eh \leq -6.8 \cdot 10^{-15} \lor \neg \left(eh \leq 2.85 \cdot 10^{-11}\right):\\
\;\;\;\;\left|ew - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{eh \cdot \left(-t\right)}{ew}\right)\right|\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if eh < -6.8000000000000001e-15 or 2.8499999999999999e-11 < eh

    1. Initial program 99.8%

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

      \[\leadsto \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{\color{blue}{-1 \cdot \left(eh \cdot t\right)}}{ew}\right)\right| \]
    4. Step-by-step derivation
      1. mul-1-neg99.6%

        \[\leadsto \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{\color{blue}{-eh \cdot t}}{ew}\right)\right| \]
      2. distribute-rgt-neg-in99.6%

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

      \[\leadsto \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{\color{blue}{eh \cdot \left(-t\right)}}{ew}\right)\right| \]
    6. Step-by-step derivation
      1. associate-*r/99.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -6.8000000000000001e-15 < eh < 2.8499999999999999e-11

    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. fabs-sub99.8%

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

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

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

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

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

        \[\leadsto \left|\color{blue}{\mathsf{fma}\left(ew, -\cos t \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)}\right| \]
    3. Simplified99.8%

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

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

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

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

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

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

        \[\leadsto \left|\mathsf{fma}\left(ew, \cos \tan^{-1} \left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right) \cdot \left(-\cos t\right), \color{blue}{0 \cdot \frac{eh}{2}}\right)\right| \]
      4. mul0-lft89.9%

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

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

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

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

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

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

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

        \[\leadsto \left|\sqrt{ew} \cdot \left(\sqrt{ew} \cdot \left(\left(-\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)}}}\right)\right)\right| \]
      7. un-div-inv36.8%

        \[\leadsto \left|\sqrt{ew} \cdot \left(\sqrt{ew} \cdot \color{blue}{\frac{-\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)}}}\right)\right| \]
      8. add-sqr-sqrt10.1%

        \[\leadsto \left|\sqrt{ew} \cdot \left(\sqrt{ew} \cdot \frac{\color{blue}{\sqrt{-\cos t} \cdot \sqrt{-\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)}}\right)\right| \]
      9. sqrt-unprod36.8%

        \[\leadsto \left|\sqrt{ew} \cdot \left(\sqrt{ew} \cdot \frac{\color{blue}{\sqrt{\left(-\cos t\right) \cdot \left(-\cos t\right)}}}{\sqrt{1 + \left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right) \cdot \left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right)}}\right)\right| \]
      10. sqr-neg36.8%

        \[\leadsto \left|\sqrt{ew} \cdot \left(\sqrt{ew} \cdot \frac{\sqrt{\color{blue}{\cos t \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)}}\right)\right| \]
      11. sqrt-unprod26.7%

        \[\leadsto \left|\sqrt{ew} \cdot \left(\sqrt{ew} \cdot \frac{\color{blue}{\sqrt{\cos t} \cdot \sqrt{\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)}}\right)\right| \]
      12. add-sqr-sqrt36.8%

        \[\leadsto \left|\sqrt{ew} \cdot \left(\sqrt{ew} \cdot \frac{\color{blue}{\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)}}\right)\right| \]
      13. hypot-1-def36.8%

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

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

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

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

Alternative 10: 61.9% 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. Step-by-step derivation
    1. fabs-sub99.8%

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

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

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

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

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

      \[\leadsto \left|\color{blue}{\mathsf{fma}\left(ew, -\cos t \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)}\right| \]
  3. Simplified99.8%

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

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

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

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

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

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

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

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

    \[\leadsto \left|\mathsf{fma}\left(ew, \cos \tan^{-1} \left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right) \cdot \left(-\cos t\right), \color{blue}{0}\right)\right| \]
  9. Step-by-step derivation
    1. fma-undefine64.2%

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

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

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

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

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

      \[\leadsto \left|\sqrt{ew} \cdot \left(\sqrt{ew} \cdot \left(\left(-\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)}}}\right)\right)\right| \]
    7. un-div-inv27.6%

      \[\leadsto \left|\sqrt{ew} \cdot \left(\sqrt{ew} \cdot \color{blue}{\frac{-\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)}}}\right)\right| \]
    8. add-sqr-sqrt5.9%

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

      \[\leadsto \left|\sqrt{ew} \cdot \left(\sqrt{ew} \cdot \frac{\color{blue}{\sqrt{\left(-\cos t\right) \cdot \left(-\cos t\right)}}}{\sqrt{1 + \left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right) \cdot \left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right)}}\right)\right| \]
    10. sqr-neg27.6%

      \[\leadsto \left|\sqrt{ew} \cdot \left(\sqrt{ew} \cdot \frac{\sqrt{\color{blue}{\cos t \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)}}\right)\right| \]
    11. sqrt-unprod21.7%

      \[\leadsto \left|\sqrt{ew} \cdot \left(\sqrt{ew} \cdot \frac{\color{blue}{\sqrt{\cos t} \cdot \sqrt{\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)}}\right)\right| \]
    12. add-sqr-sqrt27.6%

      \[\leadsto \left|\sqrt{ew} \cdot \left(\sqrt{ew} \cdot \frac{\color{blue}{\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)}}\right)\right| \]
    13. hypot-1-def27.6%

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

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

    \[\leadsto \left|\color{blue}{ew \cdot \cos t}\right| \]
  12. Final simplification64.4%

    \[\leadsto \left|ew \cdot \cos t\right| \]
  13. Add Preprocessing

Alternative 11: 42.7% 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. Step-by-step derivation
    1. fabs-sub99.8%

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

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

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

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

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

      \[\leadsto \left|\color{blue}{\mathsf{fma}\left(ew, -\cos t \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)}\right| \]
  3. Simplified99.8%

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

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

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

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

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

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

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

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

    \[\leadsto \left|\mathsf{fma}\left(ew, \cos \tan^{-1} \left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right) \cdot \left(-\cos t\right), \color{blue}{0}\right)\right| \]
  9. Step-by-step derivation
    1. fma-undefine64.2%

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

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

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

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

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

      \[\leadsto \left|\sqrt{ew} \cdot \left(\sqrt{ew} \cdot \left(\left(-\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)}}}\right)\right)\right| \]
    7. un-div-inv27.6%

      \[\leadsto \left|\sqrt{ew} \cdot \left(\sqrt{ew} \cdot \color{blue}{\frac{-\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)}}}\right)\right| \]
    8. add-sqr-sqrt5.9%

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

      \[\leadsto \left|\sqrt{ew} \cdot \left(\sqrt{ew} \cdot \frac{\color{blue}{\sqrt{\left(-\cos t\right) \cdot \left(-\cos t\right)}}}{\sqrt{1 + \left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right) \cdot \left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right)}}\right)\right| \]
    10. sqr-neg27.6%

      \[\leadsto \left|\sqrt{ew} \cdot \left(\sqrt{ew} \cdot \frac{\sqrt{\color{blue}{\cos t \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)}}\right)\right| \]
    11. sqrt-unprod21.7%

      \[\leadsto \left|\sqrt{ew} \cdot \left(\sqrt{ew} \cdot \frac{\color{blue}{\sqrt{\cos t} \cdot \sqrt{\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)}}\right)\right| \]
    12. add-sqr-sqrt27.6%

      \[\leadsto \left|\sqrt{ew} \cdot \left(\sqrt{ew} \cdot \frac{\color{blue}{\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)}}\right)\right| \]
    13. hypot-1-def27.6%

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

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

    \[\leadsto \left|\color{blue}{ew}\right| \]
  12. Final simplification43.7%

    \[\leadsto \left|ew\right| \]
  13. Add Preprocessing

Reproduce

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