Example 2 from Robby

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 99.8% accurate, 1.0× speedup?

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

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

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

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

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

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

Alternative 3: 99.8% accurate, 1.1× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 99.2% accurate, 1.1× speedup?

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 99.2% accurate, 1.3× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 98.7% accurate, 1.5× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 84.1% accurate, 1.8× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if ew < -6.4999999999999997e120 or 8.49999999999999986e81 < ew

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \left|ew \cdot \left(\cos t \cdot \frac{1}{\mathsf{hypot}\left(1, \tan t \cdot \frac{eh}{ew}\right)}\right) - \color{blue}{eh \cdot \left(t \cdot \sin \tan^{-1} \left(-1 \cdot \frac{eh \cdot t}{ew}\right)\right)}\right| \]
    11. Step-by-step derivation
      1. mul-1-neg91.7%

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

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

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

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

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

    if -6.4999999999999997e120 < ew < 8.49999999999999986e81

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \left|\color{blue}{\sqrt{{\left(\frac{ew}{\mathsf{hypot}\left(1, \frac{\tan t}{\frac{ew}{eh}}\right)}\right)}^{2}}} - \sin t \cdot eh\right| \]
    13. Step-by-step derivation
      1. unpow277.7%

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

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

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

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

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

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

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

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

Alternative 8: 90.0% accurate, 1.8× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 9: 98.7% accurate, 1.8× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \left|\color{blue}{\left(e^{\mathsf{log1p}\left(ew \cdot \frac{\cos t}{\mathsf{hypot}\left(1, \tan t \cdot \frac{eh}{ew}\right)}\right)} - 1\right)} - \sin t \cdot eh\right| \]
  10. Step-by-step derivation
    1. expm1-def70.6%

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

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

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

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

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

Alternative 10: 84.1% accurate, 2.2× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if ew < -1.1499999999999999e121 or 1.55000000000000016e82 < ew

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \left|ew \cdot \left(\cos t \cdot \frac{1}{\mathsf{hypot}\left(1, \tan t \cdot \frac{eh}{ew}\right)}\right) - \color{blue}{eh \cdot \left(t \cdot \sin \tan^{-1} \left(-1 \cdot \frac{eh \cdot t}{ew}\right)\right)}\right| \]
    11. Step-by-step derivation
      1. mul-1-neg91.7%

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

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

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

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

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

    if -1.1499999999999999e121 < ew < 1.55000000000000016e82

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 11: 75.3% accurate, 2.2× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.4 \cdot 10^{-8} \lor \neg \left(t \leq 0.00052\right):\\
\;\;\;\;\left|\frac{0}{\frac{2}{ew}} - eh \cdot \sin t\right|\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -2.39999999999999998e-8 or 5.19999999999999954e-4 < t

    1. Initial program 99.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left|ew \cdot \color{blue}{\frac{\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)}{2}} - \sin t \cdot eh\right| \]
      2. associate-*r/97.6%

        \[\leadsto \left|\color{blue}{\frac{ew \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}} - \sin t \cdot eh\right| \]
    9. Applied egg-rr97.6%

      \[\leadsto \left|\color{blue}{\frac{ew \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}} - \sin t \cdot eh\right| \]
    10. Step-by-step derivation
      1. *-commutative97.6%

        \[\leadsto \left|\frac{\color{blue}{\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) \cdot ew}}{2} - \sin t \cdot eh\right| \]
      2. associate-/l*97.5%

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

      \[\leadsto \left|\color{blue}{\frac{\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)}{\frac{2}{ew}}} - \sin t \cdot eh\right| \]
    12. Applied egg-rr0.0%

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

        \[\leadsto \left|\frac{\color{blue}{0}}{\frac{2}{ew}} - \sin t \cdot eh\right| \]
    14. Simplified52.7%

      \[\leadsto \left|\frac{\color{blue}{0}}{\frac{2}{ew}} - \sin t \cdot eh\right| \]

    if -2.39999999999999998e-8 < t < 5.19999999999999954e-4

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 12: 79.6% accurate, 2.2× speedup?

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

\\
\left|\frac{ew}{\mathsf{hypot}\left(1, \frac{\tan t}{\frac{ew}{eh}}\right)} - eh \cdot \sin 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. associate-*l*99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \left|\frac{ew}{\color{blue}{\mathsf{hypot}\left(1, \left(-\tan t\right) \cdot \frac{eh}{ew}\right)}} - \sin t \cdot eh\right| \]
    4. clear-num80.1%

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

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

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

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

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

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

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

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

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

Alternative 13: 42.3% accurate, 4.4× speedup?

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

\\
\left|\frac{0}{\frac{2}{ew}} - eh \cdot \sin 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. associate-*l*99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \left|ew \cdot \color{blue}{\frac{\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)}{2}} - \sin t \cdot eh\right| \]
    2. associate-*r/97.9%

      \[\leadsto \left|\color{blue}{\frac{ew \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}} - \sin t \cdot eh\right| \]
  9. Applied egg-rr97.9%

    \[\leadsto \left|\color{blue}{\frac{ew \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}} - \sin t \cdot eh\right| \]
  10. Step-by-step derivation
    1. *-commutative97.9%

      \[\leadsto \left|\frac{\color{blue}{\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) \cdot ew}}{2} - \sin t \cdot eh\right| \]
    2. associate-/l*97.7%

      \[\leadsto \left|\color{blue}{\frac{\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)}{\frac{2}{ew}}} - \sin t \cdot eh\right| \]
  11. Simplified97.7%

    \[\leadsto \left|\color{blue}{\frac{\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)}{\frac{2}{ew}}} - \sin t \cdot eh\right| \]
  12. Applied egg-rr0.0%

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

      \[\leadsto \left|\frac{\color{blue}{0}}{\frac{2}{ew}} - \sin t \cdot eh\right| \]
  14. Simplified38.4%

    \[\leadsto \left|\frac{\color{blue}{0}}{\frac{2}{ew}} - \sin t \cdot eh\right| \]
  15. Final simplification38.4%

    \[\leadsto \left|\frac{0}{\frac{2}{ew}} - eh \cdot \sin t\right| \]
  16. Add Preprocessing

Reproduce

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