Example 2 from Robby

Percentage Accurate: 99.8% → 99.8%
Time: 20.4s
Alternatives: 7
Speedup: N/A×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 7 alternatives:

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

Initial Program: 99.8% accurate, 1.0× speedup?

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

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

Alternative 1: 99.8% accurate, 1.1× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \left|\color{blue}{\sqrt[3]{{\left(\frac{ew \cdot \cos t}{\mathsf{hypot}\left(1, eh \cdot \frac{\tan t}{ew}\right)}\right)}^{3}}} - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{-eh}{\frac{ew}{\tan t}}\right)\right| \]
  6. Step-by-step derivation
    1. rem-cbrt-cube99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 99.1% accurate, 1.3× speedup?

\[\begin{array}{l} \\ \left|ew \cdot \left(\cos t \cdot \frac{1}{\mathsf{hypot}\left(1, eh \cdot \frac{\tan t}{ew}\right)}\right) - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{-eh}{\frac{ew}{t}}\right)\right| \end{array} \]
(FPCore (eh ew t)
 :precision binary64
 (fabs
  (-
   (* ew (* (cos t) (/ 1.0 (hypot 1.0 (* eh (/ (tan t) ew))))))
   (* (* eh (sin t)) (sin (atan (/ (- eh) (/ ew t))))))))
double code(double eh, double ew, double t) {
	return fabs(((ew * (cos(t) * (1.0 / hypot(1.0, (eh * (tan(t) / ew)))))) - ((eh * sin(t)) * 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, (eh * (Math.tan(t) / ew)))))) - ((eh * Math.sin(t)) * 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, (eh * (math.tan(t) / ew)))))) - ((eh * math.sin(t)) * 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(eh * Float64(tan(t) / ew)))))) - Float64(Float64(eh * sin(t)) * 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, (eh * (tan(t) / ew)))))) - ((eh * sin(t)) * 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[(eh * N[(N[Tan[t], $MachinePrecision] / ew), $MachinePrecision]), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(eh * N[Sin[t], $MachinePrecision]), $MachinePrecision] * N[Sin[N[ArcTan[N[((-eh) / N[(ew / t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 98.5% accurate, 1.5× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 87.5% accurate, 1.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;eh \leq -6.2 \cdot 10^{-85} \lor \neg \left(eh \leq 2.2 \cdot 10^{-57}\right):\\
\;\;\;\;\left|ew - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{-eh}{\frac{ew}{\tan t}}\right)\right|\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if eh < -6.2000000000000005e-85 or 2.19999999999999999e-57 < eh

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

    if -6.2000000000000005e-85 < eh < 2.19999999999999999e-57

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left|\mathsf{fma}\left(ew, \color{blue}{\log \left(1 + \mathsf{expm1}\left(\cos \tan^{-1} \left(\left(-\tan t\right) \cdot \frac{eh}{ew}\right) \cdot \left(-\cos t\right)\right)\right)}, 0\right)\right| \]
      3. *-commutative86.6%

        \[\leadsto \left|\mathsf{fma}\left(ew, \log \left(1 + \mathsf{expm1}\left(\color{blue}{\left(-\cos t\right) \cdot \cos \tan^{-1} \left(\left(-\tan t\right) \cdot \frac{eh}{ew}\right)}\right)\right), 0\right)\right| \]
      4. cos-atan86.6%

        \[\leadsto \left|\mathsf{fma}\left(ew, \log \left(1 + \mathsf{expm1}\left(\left(-\cos t\right) \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)}}}\right)\right), 0\right)\right| \]
      5. un-div-inv86.6%

        \[\leadsto \left|\mathsf{fma}\left(ew, \log \left(1 + \mathsf{expm1}\left(\color{blue}{\frac{-\cos t}{\sqrt{1 + \left(\left(-\tan t\right) \cdot \frac{eh}{ew}\right) \cdot \left(\left(-\tan t\right) \cdot \frac{eh}{ew}\right)}}}\right)\right), 0\right)\right| \]
      6. add-sqr-sqrt21.8%

        \[\leadsto \left|\mathsf{fma}\left(ew, \log \left(1 + \mathsf{expm1}\left(\frac{\color{blue}{\sqrt{-\cos t} \cdot \sqrt{-\cos t}}}{\sqrt{1 + \left(\left(-\tan t\right) \cdot \frac{eh}{ew}\right) \cdot \left(\left(-\tan t\right) \cdot \frac{eh}{ew}\right)}}\right)\right), 0\right)\right| \]
      7. sqrt-unprod86.7%

        \[\leadsto \left|\mathsf{fma}\left(ew, \log \left(1 + \mathsf{expm1}\left(\frac{\color{blue}{\sqrt{\left(-\cos t\right) \cdot \left(-\cos t\right)}}}{\sqrt{1 + \left(\left(-\tan t\right) \cdot \frac{eh}{ew}\right) \cdot \left(\left(-\tan t\right) \cdot \frac{eh}{ew}\right)}}\right)\right), 0\right)\right| \]
      8. sqr-neg86.7%

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

        \[\leadsto \left|\mathsf{fma}\left(ew, \log \left(1 + \mathsf{expm1}\left(\frac{\color{blue}{\sqrt{\cos t} \cdot \sqrt{\cos t}}}{\sqrt{1 + \left(\left(-\tan t\right) \cdot \frac{eh}{ew}\right) \cdot \left(\left(-\tan t\right) \cdot \frac{eh}{ew}\right)}}\right)\right), 0\right)\right| \]
      10. add-sqr-sqrt86.6%

        \[\leadsto \left|\mathsf{fma}\left(ew, \log \left(1 + \mathsf{expm1}\left(\frac{\color{blue}{\cos t}}{\sqrt{1 + \left(\left(-\tan t\right) \cdot \frac{eh}{ew}\right) \cdot \left(\left(-\tan t\right) \cdot \frac{eh}{ew}\right)}}\right)\right), 0\right)\right| \]
      11. hypot-1-def86.6%

        \[\leadsto \left|\mathsf{fma}\left(ew, \log \left(1 + \mathsf{expm1}\left(\frac{\cos t}{\color{blue}{\mathsf{hypot}\left(1, \left(-\tan t\right) \cdot \frac{eh}{ew}\right)}}\right)\right), 0\right)\right| \]
      12. *-commutative86.6%

        \[\leadsto \left|\mathsf{fma}\left(ew, \log \left(1 + \mathsf{expm1}\left(\frac{\cos t}{\mathsf{hypot}\left(1, \color{blue}{\frac{eh}{ew} \cdot \left(-\tan t\right)}\right)}\right)\right), 0\right)\right| \]
      13. frac-2neg86.6%

        \[\leadsto \left|\mathsf{fma}\left(ew, \log \left(1 + \mathsf{expm1}\left(\frac{\cos t}{\mathsf{hypot}\left(1, \color{blue}{\frac{-eh}{-ew}} \cdot \left(-\tan t\right)\right)}\right)\right), 0\right)\right| \]
      14. associate-/r/86.6%

        \[\leadsto \left|\mathsf{fma}\left(ew, \log \left(1 + \mathsf{expm1}\left(\frac{\cos t}{\mathsf{hypot}\left(1, \color{blue}{\frac{-eh}{\frac{-ew}{-\tan t}}}\right)}\right)\right), 0\right)\right| \]
    8. Applied egg-rr86.6%

      \[\leadsto \left|\mathsf{fma}\left(ew, \color{blue}{\log \left(1 + \mathsf{expm1}\left(\frac{\cos t}{\mathsf{hypot}\left(1, eh \cdot \frac{\tan t}{ew}\right)}\right)\right)}, 0\right)\right| \]
    9. Taylor expanded in eh around 0 86.9%

      \[\leadsto \left|\mathsf{fma}\left(ew, \log \color{blue}{\left(e^{\cos t}\right)}, 0\right)\right| \]
    10. Step-by-step derivation
      1. add-log-exp87.2%

        \[\leadsto \left|\mathsf{fma}\left(ew, \color{blue}{\cos t}, 0\right)\right| \]
      2. fma-udef87.2%

        \[\leadsto \left|\color{blue}{ew \cdot \cos t + 0}\right| \]
      3. +-rgt-identity87.2%

        \[\leadsto \left|\color{blue}{ew \cdot \cos t}\right| \]
      4. *-commutative87.2%

        \[\leadsto \left|\color{blue}{\cos t \cdot ew}\right| \]
    11. Applied egg-rr87.2%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;eh \leq -6.2 \cdot 10^{-85} \lor \neg \left(eh \leq 2.2 \cdot 10^{-57}\right):\\ \;\;\;\;\left|ew - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{-eh}{\frac{ew}{\tan t}}\right)\right|\\ \mathbf{else}:\\ \;\;\;\;\left|ew \cdot \cos t\right|\\ \end{array} \]

Alternative 5: 98.3% accurate, 1.8× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 62.0% accurate, 4.5× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \left|\mathsf{fma}\left(ew, \color{blue}{\log \left(1 + \mathsf{expm1}\left(\cos \tan^{-1} \left(\left(-\tan t\right) \cdot \frac{eh}{ew}\right) \cdot \left(-\cos t\right)\right)\right)}, 0\right)\right| \]
    3. *-commutative57.6%

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

      \[\leadsto \left|\mathsf{fma}\left(ew, \log \left(1 + \mathsf{expm1}\left(\left(-\cos t\right) \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)}}}\right)\right), 0\right)\right| \]
    5. un-div-inv57.4%

      \[\leadsto \left|\mathsf{fma}\left(ew, \log \left(1 + \mathsf{expm1}\left(\color{blue}{\frac{-\cos t}{\sqrt{1 + \left(\left(-\tan t\right) \cdot \frac{eh}{ew}\right) \cdot \left(\left(-\tan t\right) \cdot \frac{eh}{ew}\right)}}}\right)\right), 0\right)\right| \]
    6. add-sqr-sqrt13.3%

      \[\leadsto \left|\mathsf{fma}\left(ew, \log \left(1 + \mathsf{expm1}\left(\frac{\color{blue}{\sqrt{-\cos t} \cdot \sqrt{-\cos t}}}{\sqrt{1 + \left(\left(-\tan t\right) \cdot \frac{eh}{ew}\right) \cdot \left(\left(-\tan t\right) \cdot \frac{eh}{ew}\right)}}\right)\right), 0\right)\right| \]
    7. sqrt-unprod57.4%

      \[\leadsto \left|\mathsf{fma}\left(ew, \log \left(1 + \mathsf{expm1}\left(\frac{\color{blue}{\sqrt{\left(-\cos t\right) \cdot \left(-\cos t\right)}}}{\sqrt{1 + \left(\left(-\tan t\right) \cdot \frac{eh}{ew}\right) \cdot \left(\left(-\tan t\right) \cdot \frac{eh}{ew}\right)}}\right)\right), 0\right)\right| \]
    8. sqr-neg57.4%

      \[\leadsto \left|\mathsf{fma}\left(ew, \log \left(1 + \mathsf{expm1}\left(\frac{\sqrt{\color{blue}{\cos t \cdot \cos t}}}{\sqrt{1 + \left(\left(-\tan t\right) \cdot \frac{eh}{ew}\right) \cdot \left(\left(-\tan t\right) \cdot \frac{eh}{ew}\right)}}\right)\right), 0\right)\right| \]
    9. sqrt-unprod44.1%

      \[\leadsto \left|\mathsf{fma}\left(ew, \log \left(1 + \mathsf{expm1}\left(\frac{\color{blue}{\sqrt{\cos t} \cdot \sqrt{\cos t}}}{\sqrt{1 + \left(\left(-\tan t\right) \cdot \frac{eh}{ew}\right) \cdot \left(\left(-\tan t\right) \cdot \frac{eh}{ew}\right)}}\right)\right), 0\right)\right| \]
    10. add-sqr-sqrt57.3%

      \[\leadsto \left|\mathsf{fma}\left(ew, \log \left(1 + \mathsf{expm1}\left(\frac{\color{blue}{\cos t}}{\sqrt{1 + \left(\left(-\tan t\right) \cdot \frac{eh}{ew}\right) \cdot \left(\left(-\tan t\right) \cdot \frac{eh}{ew}\right)}}\right)\right), 0\right)\right| \]
    11. hypot-1-def57.3%

      \[\leadsto \left|\mathsf{fma}\left(ew, \log \left(1 + \mathsf{expm1}\left(\frac{\cos t}{\color{blue}{\mathsf{hypot}\left(1, \left(-\tan t\right) \cdot \frac{eh}{ew}\right)}}\right)\right), 0\right)\right| \]
    12. *-commutative57.3%

      \[\leadsto \left|\mathsf{fma}\left(ew, \log \left(1 + \mathsf{expm1}\left(\frac{\cos t}{\mathsf{hypot}\left(1, \color{blue}{\frac{eh}{ew} \cdot \left(-\tan t\right)}\right)}\right)\right), 0\right)\right| \]
    13. frac-2neg57.3%

      \[\leadsto \left|\mathsf{fma}\left(ew, \log \left(1 + \mathsf{expm1}\left(\frac{\cos t}{\mathsf{hypot}\left(1, \color{blue}{\frac{-eh}{-ew}} \cdot \left(-\tan t\right)\right)}\right)\right), 0\right)\right| \]
    14. associate-/r/57.3%

      \[\leadsto \left|\mathsf{fma}\left(ew, \log \left(1 + \mathsf{expm1}\left(\frac{\cos t}{\mathsf{hypot}\left(1, \color{blue}{\frac{-eh}{\frac{-ew}{-\tan t}}}\right)}\right)\right), 0\right)\right| \]
  8. Applied egg-rr57.3%

    \[\leadsto \left|\mathsf{fma}\left(ew, \color{blue}{\log \left(1 + \mathsf{expm1}\left(\frac{\cos t}{\mathsf{hypot}\left(1, eh \cdot \frac{\tan t}{ew}\right)}\right)\right)}, 0\right)\right| \]
  9. Taylor expanded in eh around 0 58.1%

    \[\leadsto \left|\mathsf{fma}\left(ew, \log \color{blue}{\left(e^{\cos t}\right)}, 0\right)\right| \]
  10. Step-by-step derivation
    1. add-log-exp58.4%

      \[\leadsto \left|\mathsf{fma}\left(ew, \color{blue}{\cos t}, 0\right)\right| \]
    2. fma-udef58.4%

      \[\leadsto \left|\color{blue}{ew \cdot \cos t + 0}\right| \]
    3. +-rgt-identity58.4%

      \[\leadsto \left|\color{blue}{ew \cdot \cos t}\right| \]
    4. *-commutative58.4%

      \[\leadsto \left|\color{blue}{\cos t \cdot ew}\right| \]
  11. Applied egg-rr58.4%

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

    \[\leadsto \left|ew \cdot \cos t\right| \]

Alternative 7: 39.5% accurate, 8.4× speedup?

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

\\
\left|ew + -0.5 \cdot \left(ew \cdot \left(t \cdot t\right)\right)\right|
\end{array}
Derivation
  1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \left|\mathsf{fma}\left(ew, \color{blue}{\log \left(1 + \mathsf{expm1}\left(\cos \tan^{-1} \left(\left(-\tan t\right) \cdot \frac{eh}{ew}\right) \cdot \left(-\cos t\right)\right)\right)}, 0\right)\right| \]
    3. *-commutative57.6%

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

      \[\leadsto \left|\mathsf{fma}\left(ew, \log \left(1 + \mathsf{expm1}\left(\left(-\cos t\right) \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)}}}\right)\right), 0\right)\right| \]
    5. un-div-inv57.4%

      \[\leadsto \left|\mathsf{fma}\left(ew, \log \left(1 + \mathsf{expm1}\left(\color{blue}{\frac{-\cos t}{\sqrt{1 + \left(\left(-\tan t\right) \cdot \frac{eh}{ew}\right) \cdot \left(\left(-\tan t\right) \cdot \frac{eh}{ew}\right)}}}\right)\right), 0\right)\right| \]
    6. add-sqr-sqrt13.3%

      \[\leadsto \left|\mathsf{fma}\left(ew, \log \left(1 + \mathsf{expm1}\left(\frac{\color{blue}{\sqrt{-\cos t} \cdot \sqrt{-\cos t}}}{\sqrt{1 + \left(\left(-\tan t\right) \cdot \frac{eh}{ew}\right) \cdot \left(\left(-\tan t\right) \cdot \frac{eh}{ew}\right)}}\right)\right), 0\right)\right| \]
    7. sqrt-unprod57.4%

      \[\leadsto \left|\mathsf{fma}\left(ew, \log \left(1 + \mathsf{expm1}\left(\frac{\color{blue}{\sqrt{\left(-\cos t\right) \cdot \left(-\cos t\right)}}}{\sqrt{1 + \left(\left(-\tan t\right) \cdot \frac{eh}{ew}\right) \cdot \left(\left(-\tan t\right) \cdot \frac{eh}{ew}\right)}}\right)\right), 0\right)\right| \]
    8. sqr-neg57.4%

      \[\leadsto \left|\mathsf{fma}\left(ew, \log \left(1 + \mathsf{expm1}\left(\frac{\sqrt{\color{blue}{\cos t \cdot \cos t}}}{\sqrt{1 + \left(\left(-\tan t\right) \cdot \frac{eh}{ew}\right) \cdot \left(\left(-\tan t\right) \cdot \frac{eh}{ew}\right)}}\right)\right), 0\right)\right| \]
    9. sqrt-unprod44.1%

      \[\leadsto \left|\mathsf{fma}\left(ew, \log \left(1 + \mathsf{expm1}\left(\frac{\color{blue}{\sqrt{\cos t} \cdot \sqrt{\cos t}}}{\sqrt{1 + \left(\left(-\tan t\right) \cdot \frac{eh}{ew}\right) \cdot \left(\left(-\tan t\right) \cdot \frac{eh}{ew}\right)}}\right)\right), 0\right)\right| \]
    10. add-sqr-sqrt57.3%

      \[\leadsto \left|\mathsf{fma}\left(ew, \log \left(1 + \mathsf{expm1}\left(\frac{\color{blue}{\cos t}}{\sqrt{1 + \left(\left(-\tan t\right) \cdot \frac{eh}{ew}\right) \cdot \left(\left(-\tan t\right) \cdot \frac{eh}{ew}\right)}}\right)\right), 0\right)\right| \]
    11. hypot-1-def57.3%

      \[\leadsto \left|\mathsf{fma}\left(ew, \log \left(1 + \mathsf{expm1}\left(\frac{\cos t}{\color{blue}{\mathsf{hypot}\left(1, \left(-\tan t\right) \cdot \frac{eh}{ew}\right)}}\right)\right), 0\right)\right| \]
    12. *-commutative57.3%

      \[\leadsto \left|\mathsf{fma}\left(ew, \log \left(1 + \mathsf{expm1}\left(\frac{\cos t}{\mathsf{hypot}\left(1, \color{blue}{\frac{eh}{ew} \cdot \left(-\tan t\right)}\right)}\right)\right), 0\right)\right| \]
    13. frac-2neg57.3%

      \[\leadsto \left|\mathsf{fma}\left(ew, \log \left(1 + \mathsf{expm1}\left(\frac{\cos t}{\mathsf{hypot}\left(1, \color{blue}{\frac{-eh}{-ew}} \cdot \left(-\tan t\right)\right)}\right)\right), 0\right)\right| \]
    14. associate-/r/57.3%

      \[\leadsto \left|\mathsf{fma}\left(ew, \log \left(1 + \mathsf{expm1}\left(\frac{\cos t}{\mathsf{hypot}\left(1, \color{blue}{\frac{-eh}{\frac{-ew}{-\tan t}}}\right)}\right)\right), 0\right)\right| \]
  8. Applied egg-rr57.3%

    \[\leadsto \left|\mathsf{fma}\left(ew, \color{blue}{\log \left(1 + \mathsf{expm1}\left(\frac{\cos t}{\mathsf{hypot}\left(1, eh \cdot \frac{\tan t}{ew}\right)}\right)\right)}, 0\right)\right| \]
  9. Taylor expanded in eh around 0 58.1%

    \[\leadsto \left|\mathsf{fma}\left(ew, \log \color{blue}{\left(e^{\cos t}\right)}, 0\right)\right| \]
  10. Taylor expanded in t around 0 37.3%

    \[\leadsto \left|\color{blue}{ew + -0.5 \cdot \left(ew \cdot {t}^{2}\right)}\right| \]
  11. Step-by-step derivation
    1. unpow237.3%

      \[\leadsto \left|ew + -0.5 \cdot \left(ew \cdot \color{blue}{\left(t \cdot t\right)}\right)\right| \]
  12. Simplified37.3%

    \[\leadsto \left|\color{blue}{ew + -0.5 \cdot \left(ew \cdot \left(t \cdot t\right)\right)}\right| \]
  13. Final simplification37.3%

    \[\leadsto \left|ew + -0.5 \cdot \left(ew \cdot \left(t \cdot t\right)\right)\right| \]

Reproduce

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