Example 2 from Robby

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \left|\left(ew \cdot \cos t\right) \cdot \color{blue}{\left(-1 \cdot \frac{-1}{\mathsf{hypot}\left(1, \left(-eh\right) \cdot \frac{\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. Step-by-step derivation
    1. associate-*r/99.8%

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

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

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

      \[\leadsto \left|\left(ew \cdot \cos t\right) \cdot \frac{1}{\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{\left(-eh\right) \cdot \tan t}{ew}\right)\right| \]
    5. *-commutative99.8%

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \left|\left(ew \cdot \cos t\right) \cdot \left(1 \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{\left(-eh\right) \cdot \tan t}{ew}\right)\right| \]
    10. associate-/r/99.8%

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

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

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

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

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

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

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

Alternative 2: 98.9% accurate, 1.1× speedup?

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

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

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

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

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

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

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

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

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

Alternative 3: 98.3% accurate, 1.3× speedup?

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

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

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

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

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

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

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

      \[\leadsto \left|\mathsf{fma}\left(eh, \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 \sin t, ew \cdot \left(\left(-\cos t\right) \cdot \cos \tan^{-1} \left(\tan t \cdot \frac{eh}{-ew}\right)\right)\right)\right| \]
    3. associate-/l*77.9%

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

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

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

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

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

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

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

Alternative 4: 82.4% accurate, 1.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \tan^{-1} \left(\tan t \cdot \frac{eh}{-ew}\right)\\ \mathbf{if}\;ew \leq -2.2 \cdot 10^{+22}:\\ \;\;\;\;\left|\mathsf{fma}\left(eh, t, \frac{-ew}{\frac{\mathsf{hypot}\left(1, eh \cdot \frac{-\tan t}{ew}\right)}{\cos t}}\right)\right|\\ \mathbf{elif}\;ew \leq 2.4 \cdot 10^{+82}:\\ \;\;\;\;\left|\mathsf{fma}\left(eh, \sin t \cdot \sin t_1, -ew\right)\right|\\ \mathbf{else}:\\ \;\;\;\;\left|\mathsf{fma}\left(eh, t, ew \cdot \left(\cos t \cdot \left(-\cos t_1\right)\right)\right)\right|\\ \end{array} \end{array} \]
(FPCore (eh ew t)
 :precision binary64
 (let* ((t_1 (atan (* (tan t) (/ eh (- ew))))))
   (if (<= ew -2.2e+22)
     (fabs
      (fma eh t (/ (- ew) (/ (hypot 1.0 (* eh (/ (- (tan t)) ew))) (cos t)))))
     (if (<= ew 2.4e+82)
       (fabs (fma eh (* (sin t) (sin t_1)) (- ew)))
       (fabs (fma eh t (* ew (* (cos t) (- (cos t_1))))))))))
double code(double eh, double ew, double t) {
	double t_1 = atan((tan(t) * (eh / -ew)));
	double tmp;
	if (ew <= -2.2e+22) {
		tmp = fabs(fma(eh, t, (-ew / (hypot(1.0, (eh * (-tan(t) / ew))) / cos(t)))));
	} else if (ew <= 2.4e+82) {
		tmp = fabs(fma(eh, (sin(t) * sin(t_1)), -ew));
	} else {
		tmp = fabs(fma(eh, t, (ew * (cos(t) * -cos(t_1)))));
	}
	return tmp;
}
function code(eh, ew, t)
	t_1 = atan(Float64(tan(t) * Float64(eh / Float64(-ew))))
	tmp = 0.0
	if (ew <= -2.2e+22)
		tmp = abs(fma(eh, t, Float64(Float64(-ew) / Float64(hypot(1.0, Float64(eh * Float64(Float64(-tan(t)) / ew))) / cos(t)))));
	elseif (ew <= 2.4e+82)
		tmp = abs(fma(eh, Float64(sin(t) * sin(t_1)), Float64(-ew)));
	else
		tmp = abs(fma(eh, t, Float64(ew * Float64(cos(t) * Float64(-cos(t_1))))));
	end
	return tmp
end
code[eh_, ew_, t_] := Block[{t$95$1 = N[ArcTan[N[(N[Tan[t], $MachinePrecision] * N[(eh / (-ew)), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[ew, -2.2e+22], N[Abs[N[(eh * t + N[((-ew) / N[(N[Sqrt[1.0 ^ 2 + N[(eh * N[((-N[Tan[t], $MachinePrecision]) / ew), $MachinePrecision]), $MachinePrecision] ^ 2], $MachinePrecision] / N[Cos[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[ew, 2.4e+82], N[Abs[N[(eh * N[(N[Sin[t], $MachinePrecision] * N[Sin[t$95$1], $MachinePrecision]), $MachinePrecision] + (-ew)), $MachinePrecision]], $MachinePrecision], N[Abs[N[(eh * t + N[(ew * N[(N[Cos[t], $MachinePrecision] * (-N[Cos[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)\\
\mathbf{if}\;ew \leq -2.2 \cdot 10^{+22}:\\
\;\;\;\;\left|\mathsf{fma}\left(eh, t, \frac{-ew}{\frac{\mathsf{hypot}\left(1, eh \cdot \frac{-\tan t}{ew}\right)}{\cos t}}\right)\right|\\

\mathbf{elif}\;ew \leq 2.4 \cdot 10^{+82}:\\
\;\;\;\;\left|\mathsf{fma}\left(eh, \sin t \cdot \sin t_1, -ew\right)\right|\\

\mathbf{else}:\\
\;\;\;\;\left|\mathsf{fma}\left(eh, t, ew \cdot \left(\cos t \cdot \left(-\cos t_1\right)\right)\right)\right|\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if ew < -2.2e22

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

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

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

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

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

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

        \[\leadsto \left|\mathsf{fma}\left(eh, \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 \sin t, ew \cdot \left(\left(-\cos t\right) \cdot \cos \tan^{-1} \left(\tan t \cdot \frac{eh}{-ew}\right)\right)\right)\right| \]
      3. associate-/l*98.3%

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

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

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

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

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

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

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

        \[\leadsto \left|\mathsf{fma}\left(eh, \frac{\tan t \cdot \sin t}{\frac{\sin t}{\cos t}}, \left(ew \cdot \left(-\cos t\right)\right) \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)\right| \]
      3. un-div-inv97.9%

        \[\leadsto \left|\mathsf{fma}\left(eh, \frac{\tan t \cdot \sin t}{\frac{\sin t}{\cos t}}, \color{blue}{\frac{ew \cdot \left(-\cos t\right)}{\sqrt{1 + \left(\tan t \cdot \frac{eh}{-ew}\right) \cdot \left(\tan t \cdot \frac{eh}{-ew}\right)}}}\right)\right| \]
      4. distribute-rgt-neg-out97.9%

        \[\leadsto \left|\mathsf{fma}\left(eh, \frac{\tan t \cdot \sin t}{\frac{\sin t}{\cos t}}, \frac{\color{blue}{-ew \cdot \cos t}}{\sqrt{1 + \left(\tan t \cdot \frac{eh}{-ew}\right) \cdot \left(\tan t \cdot \frac{eh}{-ew}\right)}}\right)\right| \]
      5. distribute-lft-neg-in97.9%

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

        \[\leadsto \left|\mathsf{fma}\left(eh, \frac{\tan t \cdot \sin t}{\frac{\sin t}{\cos t}}, \color{blue}{\frac{-ew}{\frac{\sqrt{1 + \left(\tan t \cdot \frac{eh}{-ew}\right) \cdot \left(\tan t \cdot \frac{eh}{-ew}\right)}}{\cos t}}}\right)\right| \]
    8. Applied egg-rr97.9%

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

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

    if -2.2e22 < ew < 2.39999999999999998e82

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;ew \leq -2.2 \cdot 10^{+22}:\\ \;\;\;\;\left|\mathsf{fma}\left(eh, t, \frac{-ew}{\frac{\mathsf{hypot}\left(1, eh \cdot \frac{-\tan t}{ew}\right)}{\cos t}}\right)\right|\\ \mathbf{elif}\;ew \leq 2.4 \cdot 10^{+82}:\\ \;\;\;\;\left|\mathsf{fma}\left(eh, \sin t \cdot \sin \tan^{-1} \left(\tan t \cdot \frac{eh}{-ew}\right), -ew\right)\right|\\ \mathbf{else}:\\ \;\;\;\;\left|\mathsf{fma}\left(eh, t, ew \cdot \left(\cos t \cdot \left(-\cos \tan^{-1} \left(\tan t \cdot \frac{eh}{-ew}\right)\right)\right)\right)\right|\\ \end{array} \]

Alternative 5: 82.4% accurate, 1.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;ew \leq -2.35 \cdot 10^{+22} \lor \neg \left(ew \leq 4.4 \cdot 10^{+84}\right):\\
\;\;\;\;\left|\mathsf{fma}\left(eh, t, \frac{-ew}{\frac{\mathsf{hypot}\left(1, eh \cdot \frac{-\tan t}{ew}\right)}{\cos t}}\right)\right|\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if ew < -2.3500000000000001e22 or 4.3999999999999997e84 < 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. 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. associate-*l*99.8%

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

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

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

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

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

        \[\leadsto \left|\mathsf{fma}\left(eh, \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 \sin t, ew \cdot \left(\left(-\cos t\right) \cdot \cos \tan^{-1} \left(\tan t \cdot \frac{eh}{-ew}\right)\right)\right)\right| \]
      3. associate-/l*98.9%

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

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

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

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

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

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

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

        \[\leadsto \left|\mathsf{fma}\left(eh, \frac{\tan t \cdot \sin t}{\frac{\sin t}{\cos t}}, \left(ew \cdot \left(-\cos t\right)\right) \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)\right| \]
      3. un-div-inv98.7%

        \[\leadsto \left|\mathsf{fma}\left(eh, \frac{\tan t \cdot \sin t}{\frac{\sin t}{\cos t}}, \color{blue}{\frac{ew \cdot \left(-\cos t\right)}{\sqrt{1 + \left(\tan t \cdot \frac{eh}{-ew}\right) \cdot \left(\tan t \cdot \frac{eh}{-ew}\right)}}}\right)\right| \]
      4. distribute-rgt-neg-out98.7%

        \[\leadsto \left|\mathsf{fma}\left(eh, \frac{\tan t \cdot \sin t}{\frac{\sin t}{\cos t}}, \frac{\color{blue}{-ew \cdot \cos t}}{\sqrt{1 + \left(\tan t \cdot \frac{eh}{-ew}\right) \cdot \left(\tan t \cdot \frac{eh}{-ew}\right)}}\right)\right| \]
      5. distribute-lft-neg-in98.7%

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

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

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

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

    if -2.3500000000000001e22 < ew < 4.3999999999999997e84

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;ew \leq -2.35 \cdot 10^{+22} \lor \neg \left(ew \leq 4.4 \cdot 10^{+84}\right):\\ \;\;\;\;\left|\mathsf{fma}\left(eh, t, \frac{-ew}{\frac{\mathsf{hypot}\left(1, eh \cdot \frac{-\tan t}{ew}\right)}{\cos t}}\right)\right|\\ \mathbf{else}:\\ \;\;\;\;\left|\mathsf{fma}\left(eh, \sin t \cdot \sin \tan^{-1} \left(\tan t \cdot \frac{eh}{-ew}\right), -ew\right)\right|\\ \end{array} \]

Alternative 6: 98.3% accurate, 1.5× speedup?

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

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

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

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

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

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

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

      \[\leadsto \left|\mathsf{fma}\left(eh, \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 \sin t, ew \cdot \left(\left(-\cos t\right) \cdot \cos \tan^{-1} \left(\tan t \cdot \frac{eh}{-ew}\right)\right)\right)\right| \]
    3. associate-/l*77.9%

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

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

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

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

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

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

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

      \[\leadsto \left|\mathsf{fma}\left(eh, \frac{\tan t \cdot \sin t}{\frac{\sin t}{\cos t}}, \left(ew \cdot \left(-\cos t\right)\right) \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)\right| \]
    3. un-div-inv93.4%

      \[\leadsto \left|\mathsf{fma}\left(eh, \frac{\tan t \cdot \sin t}{\frac{\sin t}{\cos t}}, \color{blue}{\frac{ew \cdot \left(-\cos t\right)}{\sqrt{1 + \left(\tan t \cdot \frac{eh}{-ew}\right) \cdot \left(\tan t \cdot \frac{eh}{-ew}\right)}}}\right)\right| \]
    4. distribute-rgt-neg-out93.4%

      \[\leadsto \left|\mathsf{fma}\left(eh, \frac{\tan t \cdot \sin t}{\frac{\sin t}{\cos t}}, \frac{\color{blue}{-ew \cdot \cos t}}{\sqrt{1 + \left(\tan t \cdot \frac{eh}{-ew}\right) \cdot \left(\tan t \cdot \frac{eh}{-ew}\right)}}\right)\right| \]
    5. distribute-lft-neg-in93.4%

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

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

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

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

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

Alternative 7: 71.1% accurate, 1.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := -\tan t\\ \mathbf{if}\;t \leq -4.5 \cdot 10^{+220} \lor \neg \left(t \leq -2.5 \cdot 10^{+75}\right) \land \left(t \leq -1 \lor \neg \left(t \leq 1.6 \cdot 10^{+160}\right)\right):\\ \;\;\;\;\left|\left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{eh \cdot t_1}{ew}\right)\right|\\ \mathbf{else}:\\ \;\;\;\;\left|\mathsf{fma}\left(eh, t, \frac{-ew}{\frac{\mathsf{hypot}\left(1, eh \cdot \frac{t_1}{ew}\right)}{\cos t}}\right)\right|\\ \end{array} \end{array} \]
(FPCore (eh ew t)
 :precision binary64
 (let* ((t_1 (- (tan t))))
   (if (or (<= t -4.5e+220)
           (and (not (<= t -2.5e+75)) (or (<= t -1.0) (not (<= t 1.6e+160)))))
     (fabs (* (* eh (sin t)) (sin (atan (/ (* eh t_1) ew)))))
     (fabs (fma eh t (/ (- ew) (/ (hypot 1.0 (* eh (/ t_1 ew))) (cos t))))))))
double code(double eh, double ew, double t) {
	double t_1 = -tan(t);
	double tmp;
	if ((t <= -4.5e+220) || (!(t <= -2.5e+75) && ((t <= -1.0) || !(t <= 1.6e+160)))) {
		tmp = fabs(((eh * sin(t)) * sin(atan(((eh * t_1) / ew)))));
	} else {
		tmp = fabs(fma(eh, t, (-ew / (hypot(1.0, (eh * (t_1 / ew))) / cos(t)))));
	}
	return tmp;
}
function code(eh, ew, t)
	t_1 = Float64(-tan(t))
	tmp = 0.0
	if ((t <= -4.5e+220) || (!(t <= -2.5e+75) && ((t <= -1.0) || !(t <= 1.6e+160))))
		tmp = abs(Float64(Float64(eh * sin(t)) * sin(atan(Float64(Float64(eh * t_1) / ew)))));
	else
		tmp = abs(fma(eh, t, Float64(Float64(-ew) / Float64(hypot(1.0, Float64(eh * Float64(t_1 / ew))) / cos(t)))));
	end
	return tmp
end
code[eh_, ew_, t_] := Block[{t$95$1 = (-N[Tan[t], $MachinePrecision])}, If[Or[LessEqual[t, -4.5e+220], And[N[Not[LessEqual[t, -2.5e+75]], $MachinePrecision], Or[LessEqual[t, -1.0], N[Not[LessEqual[t, 1.6e+160]], $MachinePrecision]]]], N[Abs[N[(N[(eh * N[Sin[t], $MachinePrecision]), $MachinePrecision] * N[Sin[N[ArcTan[N[(N[(eh * t$95$1), $MachinePrecision] / ew), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Abs[N[(eh * t + N[((-ew) / N[(N[Sqrt[1.0 ^ 2 + N[(eh * N[(t$95$1 / ew), $MachinePrecision]), $MachinePrecision] ^ 2], $MachinePrecision] / N[Cos[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := -\tan t\\
\mathbf{if}\;t \leq -4.5 \cdot 10^{+220} \lor \neg \left(t \leq -2.5 \cdot 10^{+75}\right) \land \left(t \leq -1 \lor \neg \left(t \leq 1.6 \cdot 10^{+160}\right)\right):\\
\;\;\;\;\left|\left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{eh \cdot t_1}{ew}\right)\right|\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -4.50000000000000011e220 or -2.5000000000000001e75 < t < -1 or 1.5999999999999999e160 < t

    1. Initial program 99.6%

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

        \[\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. associate-*l*99.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -4.50000000000000011e220 < t < -2.5000000000000001e75 or -1 < t < 1.5999999999999999e160

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

        \[\leadsto \left|\mathsf{fma}\left(eh, \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 \sin t, ew \cdot \left(\left(-\cos t\right) \cdot \cos \tan^{-1} \left(\tan t \cdot \frac{eh}{-ew}\right)\right)\right)\right| \]
      3. associate-/l*84.0%

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

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

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

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

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

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

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

        \[\leadsto \left|\mathsf{fma}\left(eh, \frac{\tan t \cdot \sin t}{\frac{\sin t}{\cos t}}, \left(ew \cdot \left(-\cos t\right)\right) \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)\right| \]
      3. un-div-inv92.4%

        \[\leadsto \left|\mathsf{fma}\left(eh, \frac{\tan t \cdot \sin t}{\frac{\sin t}{\cos t}}, \color{blue}{\frac{ew \cdot \left(-\cos t\right)}{\sqrt{1 + \left(\tan t \cdot \frac{eh}{-ew}\right) \cdot \left(\tan t \cdot \frac{eh}{-ew}\right)}}}\right)\right| \]
      4. distribute-rgt-neg-out92.4%

        \[\leadsto \left|\mathsf{fma}\left(eh, \frac{\tan t \cdot \sin t}{\frac{\sin t}{\cos t}}, \frac{\color{blue}{-ew \cdot \cos t}}{\sqrt{1 + \left(\tan t \cdot \frac{eh}{-ew}\right) \cdot \left(\tan t \cdot \frac{eh}{-ew}\right)}}\right)\right| \]
      5. distribute-lft-neg-in92.4%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -4.5 \cdot 10^{+220} \lor \neg \left(t \leq -2.5 \cdot 10^{+75}\right) \land \left(t \leq -1 \lor \neg \left(t \leq 1.6 \cdot 10^{+160}\right)\right):\\ \;\;\;\;\left|\left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{eh \cdot \left(-\tan t\right)}{ew}\right)\right|\\ \mathbf{else}:\\ \;\;\;\;\left|\mathsf{fma}\left(eh, t, \frac{-ew}{\frac{\mathsf{hypot}\left(1, eh \cdot \frac{-\tan t}{ew}\right)}{\cos t}}\right)\right|\\ \end{array} \]

Alternative 8: 74.8% accurate, 1.8× speedup?

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

\\
\begin{array}{l}
t_1 := \sin \tan^{-1} \left(\frac{eh \cdot \left(-\tan t\right)}{ew}\right)\\
\mathbf{if}\;t \leq -0.0037 \lor \neg \left(t \leq 0.02\right):\\
\;\;\;\;\left|\left(eh \cdot \sin t\right) \cdot t_1\right|\\

\mathbf{else}:\\
\;\;\;\;\left|t_1 \cdot \left(t \cdot eh\right) - ew\right|\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -0.0037000000000000002 or 0.0200000000000000004 < t

    1. Initial program 99.6%

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

        \[\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. associate-*l*99.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -0.0037000000000000002 < t < 0.0200000000000000004

    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. fabs-sub100.0%

        \[\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. associate-*l*100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 9: 55.0% accurate, 2.2× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 10: 42.7% accurate, 9.1× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \left|\color{blue}{-1 \cdot ew}\right| \]
  12. Step-by-step derivation
    1. mul-1-neg42.5%

      \[\leadsto \left|\color{blue}{-ew}\right| \]
  13. Simplified42.5%

    \[\leadsto \left|\color{blue}{-ew}\right| \]
  14. Final simplification42.5%

    \[\leadsto \left|ew\right| \]

Reproduce

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