Example 2 from Robby

Percentage Accurate: 99.8% → 99.8%
Time: 20.2s
Alternatives: 9
Speedup: 1.0×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 9 alternatives:

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

Initial Program: 99.8% accurate, 1.0× speedup?

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

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

Alternative 1: 99.8% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \tan^{-1} \left(\frac{eh \cdot \tan t}{0 - 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)) (- 0.0 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)) / (0.0 - 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)) / (0.0d0 - 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)) / (0.0 - 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)) / (0.0 - 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(eh * tan(t)) / Float64(0.0 - 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)) / (0.0 - 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] / N[(0.0 - ew), $MachinePrecision]), $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{eh \cdot \tan t}{0 - 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}
Derivation
  1. Initial program 99.8%

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

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

Alternative 2: 99.8% accurate, 1.1× speedup?

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

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

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

      \[\leadsto \mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(\left(\left(ew \cdot \cos t\right) \cdot \frac{1}{\sqrt{1 + \frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t}{ew} \cdot \frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t}{ew}}}\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(eh, \mathsf{sin.f64}\left(t\right)\right), \mathsf{sin.f64}\left(\mathsf{atan.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{neg.f64}\left(eh\right), \mathsf{tan.f64}\left(t\right)\right), ew\right)\right)\right)\right)\right)\right) \]
    2. un-div-invN/A

      \[\leadsto \mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(\left(\frac{ew \cdot \cos t}{\sqrt{1 + \frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t}{ew} \cdot \frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t}{ew}}}\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(eh, \mathsf{sin.f64}\left(t\right)\right), \mathsf{sin.f64}\left(\mathsf{atan.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{neg.f64}\left(eh\right), \mathsf{tan.f64}\left(t\right)\right), ew\right)\right)\right)\right)\right)\right) \]
    3. /-lowering-/.f64N/A

      \[\leadsto \mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(\left(ew \cdot \cos t\right), \left(\sqrt{1 + \frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t}{ew} \cdot \frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t}{ew}}\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(eh, \mathsf{sin.f64}\left(t\right)\right), \mathsf{sin.f64}\left(\mathsf{atan.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{neg.f64}\left(eh\right), \mathsf{tan.f64}\left(t\right)\right), ew\right)\right)\right)\right)\right)\right) \]
    4. *-lowering-*.f64N/A

      \[\leadsto \mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(ew, \cos t\right), \left(\sqrt{1 + \frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t}{ew} \cdot \frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t}{ew}}\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(eh, \mathsf{sin.f64}\left(t\right)\right), \mathsf{sin.f64}\left(\mathsf{atan.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{neg.f64}\left(eh\right), \mathsf{tan.f64}\left(t\right)\right), ew\right)\right)\right)\right)\right)\right) \]
    5. cos-lowering-cos.f64N/A

      \[\leadsto \mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(ew, \mathsf{cos.f64}\left(t\right)\right), \left(\sqrt{1 + \frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t}{ew} \cdot \frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t}{ew}}\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(eh, \mathsf{sin.f64}\left(t\right)\right), \mathsf{sin.f64}\left(\mathsf{atan.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{neg.f64}\left(eh\right), \mathsf{tan.f64}\left(t\right)\right), ew\right)\right)\right)\right)\right)\right) \]
    6. hypot-1-defN/A

      \[\leadsto \mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(ew, \mathsf{cos.f64}\left(t\right)\right), \left(\mathsf{hypot}\left(1, \frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t}{ew}\right)\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(eh, \mathsf{sin.f64}\left(t\right)\right), \mathsf{sin.f64}\left(\mathsf{atan.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{neg.f64}\left(eh\right), \mathsf{tan.f64}\left(t\right)\right), ew\right)\right)\right)\right)\right)\right) \]
    7. hypot-lowering-hypot.f64N/A

      \[\leadsto \mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(ew, \mathsf{cos.f64}\left(t\right)\right), \mathsf{hypot.f64}\left(1, \left(\frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t}{ew}\right)\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(eh, \mathsf{sin.f64}\left(t\right)\right), \mathsf{sin.f64}\left(\mathsf{atan.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{neg.f64}\left(eh\right), \mathsf{tan.f64}\left(t\right)\right), ew\right)\right)\right)\right)\right)\right) \]
    8. associate-/l*N/A

      \[\leadsto \mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(ew, \mathsf{cos.f64}\left(t\right)\right), \mathsf{hypot.f64}\left(1, \left(\left(\mathsf{neg}\left(eh\right)\right) \cdot \frac{\tan t}{ew}\right)\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(eh, \mathsf{sin.f64}\left(t\right)\right), \mathsf{sin.f64}\left(\mathsf{atan.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{neg.f64}\left(eh\right), \mathsf{tan.f64}\left(t\right)\right), ew\right)\right)\right)\right)\right)\right) \]
    9. distribute-lft-neg-outN/A

      \[\leadsto \mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(ew, \mathsf{cos.f64}\left(t\right)\right), \mathsf{hypot.f64}\left(1, \left(\mathsf{neg}\left(eh \cdot \frac{\tan t}{ew}\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(eh, \mathsf{sin.f64}\left(t\right)\right), \mathsf{sin.f64}\left(\mathsf{atan.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{neg.f64}\left(eh\right), \mathsf{tan.f64}\left(t\right)\right), ew\right)\right)\right)\right)\right)\right) \]
    10. neg-sub0N/A

      \[\leadsto \mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(ew, \mathsf{cos.f64}\left(t\right)\right), \mathsf{hypot.f64}\left(1, \left(0 - eh \cdot \frac{\tan t}{ew}\right)\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(eh, \mathsf{sin.f64}\left(t\right)\right), \mathsf{sin.f64}\left(\mathsf{atan.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{neg.f64}\left(eh\right), \mathsf{tan.f64}\left(t\right)\right), ew\right)\right)\right)\right)\right)\right) \]
    11. remove-double-negN/A

      \[\leadsto \mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(ew, \mathsf{cos.f64}\left(t\right)\right), \mathsf{hypot.f64}\left(1, \left(0 - \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(eh \cdot \frac{\tan t}{ew}\right)\right)\right)\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(eh, \mathsf{sin.f64}\left(t\right)\right), \mathsf{sin.f64}\left(\mathsf{atan.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{neg.f64}\left(eh\right), \mathsf{tan.f64}\left(t\right)\right), ew\right)\right)\right)\right)\right)\right) \]
    12. distribute-lft-neg-outN/A

      \[\leadsto \mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(ew, \mathsf{cos.f64}\left(t\right)\right), \mathsf{hypot.f64}\left(1, \left(0 - \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(eh\right)\right) \cdot \frac{\tan t}{ew}\right)\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(eh, \mathsf{sin.f64}\left(t\right)\right), \mathsf{sin.f64}\left(\mathsf{atan.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{neg.f64}\left(eh\right), \mathsf{tan.f64}\left(t\right)\right), ew\right)\right)\right)\right)\right)\right) \]
    13. associate-/l*N/A

      \[\leadsto \mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(ew, \mathsf{cos.f64}\left(t\right)\right), \mathsf{hypot.f64}\left(1, \left(0 - \left(\mathsf{neg}\left(\frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t}{ew}\right)\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(eh, \mathsf{sin.f64}\left(t\right)\right), \mathsf{sin.f64}\left(\mathsf{atan.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{neg.f64}\left(eh\right), \mathsf{tan.f64}\left(t\right)\right), ew\right)\right)\right)\right)\right)\right) \]
    14. --lowering--.f64N/A

      \[\leadsto \mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(ew, \mathsf{cos.f64}\left(t\right)\right), \mathsf{hypot.f64}\left(1, \mathsf{\_.f64}\left(0, \left(\mathsf{neg}\left(\frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t}{ew}\right)\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(eh, \mathsf{sin.f64}\left(t\right)\right), \mathsf{sin.f64}\left(\mathsf{atan.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{neg.f64}\left(eh\right), \mathsf{tan.f64}\left(t\right)\right), ew\right)\right)\right)\right)\right)\right) \]
    15. associate-/l*N/A

      \[\leadsto \mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(ew, \mathsf{cos.f64}\left(t\right)\right), \mathsf{hypot.f64}\left(1, \mathsf{\_.f64}\left(0, \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(eh\right)\right) \cdot \frac{\tan t}{ew}\right)\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(eh, \mathsf{sin.f64}\left(t\right)\right), \mathsf{sin.f64}\left(\mathsf{atan.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{neg.f64}\left(eh\right), \mathsf{tan.f64}\left(t\right)\right), ew\right)\right)\right)\right)\right)\right) \]
    16. distribute-lft-neg-outN/A

      \[\leadsto \mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(ew, \mathsf{cos.f64}\left(t\right)\right), \mathsf{hypot.f64}\left(1, \mathsf{\_.f64}\left(0, \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(eh \cdot \frac{\tan t}{ew}\right)\right)\right)\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(eh, \mathsf{sin.f64}\left(t\right)\right), \mathsf{sin.f64}\left(\mathsf{atan.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{neg.f64}\left(eh\right), \mathsf{tan.f64}\left(t\right)\right), ew\right)\right)\right)\right)\right)\right) \]
    17. remove-double-negN/A

      \[\leadsto \mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(ew, \mathsf{cos.f64}\left(t\right)\right), \mathsf{hypot.f64}\left(1, \mathsf{\_.f64}\left(0, \left(eh \cdot \frac{\tan t}{ew}\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(eh, \mathsf{sin.f64}\left(t\right)\right), \mathsf{sin.f64}\left(\mathsf{atan.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{neg.f64}\left(eh\right), \mathsf{tan.f64}\left(t\right)\right), ew\right)\right)\right)\right)\right)\right) \]
    18. clear-numN/A

      \[\leadsto \mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(ew, \mathsf{cos.f64}\left(t\right)\right), \mathsf{hypot.f64}\left(1, \mathsf{\_.f64}\left(0, \left(eh \cdot \frac{1}{\frac{ew}{\tan t}}\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(eh, \mathsf{sin.f64}\left(t\right)\right), \mathsf{sin.f64}\left(\mathsf{atan.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{neg.f64}\left(eh\right), \mathsf{tan.f64}\left(t\right)\right), ew\right)\right)\right)\right)\right)\right) \]
  4. Applied egg-rr99.8%

    \[\leadsto \left|\color{blue}{\frac{ew \cdot \cos t}{\mathsf{hypot}\left(1, 0 - \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. Final simplification99.8%

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

Alternative 3: 86.8% accurate, 1.5× speedup?

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

\\
\begin{array}{l}
t_1 := \frac{ew}{\tan t}\\
t_2 := eh \cdot \sin t\\
\mathbf{if}\;eh \leq 1.25 \cdot 10^{+217}:\\
\;\;\;\;\left|\frac{ew \cdot \cos t + t\_2 \cdot \frac{eh}{t\_1}}{\mathsf{hypot}\left(1, \frac{eh}{0 - t\_1}\right)}\right|\\

\mathbf{else}:\\
\;\;\;\;\left|t\_2 + ew \cdot \left(ew \cdot \left(\left(0.5 + 0.5 \cdot \cos \left(t \cdot 2\right)\right) \cdot \frac{0.5}{t\_2}\right)\right)\right|\\


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

    1. Initial program 99.8%

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

        \[\leadsto \mathsf{fabs.f64}\left(\left(\left(ew \cdot \cos t\right) \cdot \frac{1}{\sqrt{1 + \frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t}{ew} \cdot \frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t}{ew}}} - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t}{ew}\right)\right)\right) \]
      2. un-div-invN/A

        \[\leadsto \mathsf{fabs.f64}\left(\left(\frac{ew \cdot \cos t}{\sqrt{1 + \frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t}{ew} \cdot \frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t}{ew}}} - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t}{ew}\right)\right)\right) \]
      3. *-commutativeN/A

        \[\leadsto \mathsf{fabs.f64}\left(\left(\frac{ew \cdot \cos t}{\sqrt{1 + \frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t}{ew} \cdot \frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t}{ew}}} - \sin \tan^{-1} \left(\frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t}{ew}\right) \cdot \left(eh \cdot \sin t\right)\right)\right) \]
      4. sin-atanN/A

        \[\leadsto \mathsf{fabs.f64}\left(\left(\frac{ew \cdot \cos t}{\sqrt{1 + \frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t}{ew} \cdot \frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t}{ew}}} - \frac{\frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t}{ew}}{\sqrt{1 + \frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t}{ew} \cdot \frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t}{ew}}} \cdot \left(eh \cdot \sin t\right)\right)\right) \]
      5. associate-*l/N/A

        \[\leadsto \mathsf{fabs.f64}\left(\left(\frac{ew \cdot \cos t}{\sqrt{1 + \frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t}{ew} \cdot \frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t}{ew}}} - \frac{\frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t}{ew} \cdot \left(eh \cdot \sin t\right)}{\sqrt{1 + \frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t}{ew} \cdot \frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t}{ew}}}\right)\right) \]
      6. sub-divN/A

        \[\leadsto \mathsf{fabs.f64}\left(\left(\frac{ew \cdot \cos t - \frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t}{ew} \cdot \left(eh \cdot \sin t\right)}{\sqrt{1 + \frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t}{ew} \cdot \frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t}{ew}}}\right)\right) \]
      7. /-lowering-/.f64N/A

        \[\leadsto \mathsf{fabs.f64}\left(\mathsf{/.f64}\left(\left(ew \cdot \cos t - \frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t}{ew} \cdot \left(eh \cdot \sin t\right)\right), \left(\sqrt{1 + \frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t}{ew} \cdot \frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t}{ew}}\right)\right)\right) \]
    4. Applied egg-rr89.5%

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

    if 1.2500000000000001e217 < eh

    1. Initial program 99.8%

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

        \[\leadsto \mathsf{fabs.f64}\left(\left(\left(ew \cdot \cos t\right) \cdot \frac{1}{\sqrt{1 + \frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t}{ew} \cdot \frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t}{ew}}} - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t}{ew}\right)\right)\right) \]
      2. un-div-invN/A

        \[\leadsto \mathsf{fabs.f64}\left(\left(\frac{ew \cdot \cos t}{\sqrt{1 + \frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t}{ew} \cdot \frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t}{ew}}} - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t}{ew}\right)\right)\right) \]
      3. *-commutativeN/A

        \[\leadsto \mathsf{fabs.f64}\left(\left(\frac{ew \cdot \cos t}{\sqrt{1 + \frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t}{ew} \cdot \frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t}{ew}}} - \sin \tan^{-1} \left(\frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t}{ew}\right) \cdot \left(eh \cdot \sin t\right)\right)\right) \]
      4. sin-atanN/A

        \[\leadsto \mathsf{fabs.f64}\left(\left(\frac{ew \cdot \cos t}{\sqrt{1 + \frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t}{ew} \cdot \frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t}{ew}}} - \frac{\frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t}{ew}}{\sqrt{1 + \frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t}{ew} \cdot \frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t}{ew}}} \cdot \left(eh \cdot \sin t\right)\right)\right) \]
      5. associate-*l/N/A

        \[\leadsto \mathsf{fabs.f64}\left(\left(\frac{ew \cdot \cos t}{\sqrt{1 + \frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t}{ew} \cdot \frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t}{ew}}} - \frac{\frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t}{ew} \cdot \left(eh \cdot \sin t\right)}{\sqrt{1 + \frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t}{ew} \cdot \frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t}{ew}}}\right)\right) \]
      6. sub-divN/A

        \[\leadsto \mathsf{fabs.f64}\left(\left(\frac{ew \cdot \cos t - \frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t}{ew} \cdot \left(eh \cdot \sin t\right)}{\sqrt{1 + \frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t}{ew} \cdot \frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t}{ew}}}\right)\right) \]
      7. /-lowering-/.f64N/A

        \[\leadsto \mathsf{fabs.f64}\left(\mathsf{/.f64}\left(\left(ew \cdot \cos t - \frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t}{ew} \cdot \left(eh \cdot \sin t\right)\right), \left(\sqrt{1 + \frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t}{ew} \cdot \frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t}{ew}}\right)\right)\right) \]
    4. Applied egg-rr39.5%

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

      \[\leadsto \mathsf{fabs.f64}\left(\color{blue}{\left(eh \cdot \sin t + {ew}^{2} \cdot \left(\frac{-1}{2} \cdot \frac{{\cos t}^{2}}{eh \cdot \sin t} + \frac{{\cos t}^{2}}{eh \cdot \sin t}\right)\right)}\right) \]
    6. Step-by-step derivation
      1. distribute-lft1-inN/A

        \[\leadsto \mathsf{fabs.f64}\left(\left(eh \cdot \sin t + {ew}^{2} \cdot \left(\left(\frac{-1}{2} + 1\right) \cdot \frac{{\cos t}^{2}}{eh \cdot \sin t}\right)\right)\right) \]
      2. metadata-evalN/A

        \[\leadsto \mathsf{fabs.f64}\left(\left(eh \cdot \sin t + {ew}^{2} \cdot \left(\frac{1}{2} \cdot \frac{{\cos t}^{2}}{eh \cdot \sin t}\right)\right)\right) \]
      3. +-lowering-+.f64N/A

        \[\leadsto \mathsf{fabs.f64}\left(\mathsf{+.f64}\left(\left(eh \cdot \sin t\right), \left({ew}^{2} \cdot \left(\frac{1}{2} \cdot \frac{{\cos t}^{2}}{eh \cdot \sin t}\right)\right)\right)\right) \]
      4. *-lowering-*.f64N/A

        \[\leadsto \mathsf{fabs.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(eh, \sin t\right), \left({ew}^{2} \cdot \left(\frac{1}{2} \cdot \frac{{\cos t}^{2}}{eh \cdot \sin t}\right)\right)\right)\right) \]
      5. sin-lowering-sin.f64N/A

        \[\leadsto \mathsf{fabs.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(eh, \mathsf{sin.f64}\left(t\right)\right), \left({ew}^{2} \cdot \left(\frac{1}{2} \cdot \frac{{\cos t}^{2}}{eh \cdot \sin t}\right)\right)\right)\right) \]
      6. *-lowering-*.f64N/A

        \[\leadsto \mathsf{fabs.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(eh, \mathsf{sin.f64}\left(t\right)\right), \mathsf{*.f64}\left(\left({ew}^{2}\right), \left(\frac{1}{2} \cdot \frac{{\cos t}^{2}}{eh \cdot \sin t}\right)\right)\right)\right) \]
      7. unpow2N/A

        \[\leadsto \mathsf{fabs.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(eh, \mathsf{sin.f64}\left(t\right)\right), \mathsf{*.f64}\left(\left(ew \cdot ew\right), \left(\frac{1}{2} \cdot \frac{{\cos t}^{2}}{eh \cdot \sin t}\right)\right)\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{fabs.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(eh, \mathsf{sin.f64}\left(t\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(ew, ew\right), \left(\frac{1}{2} \cdot \frac{{\cos t}^{2}}{eh \cdot \sin t}\right)\right)\right)\right) \]
      9. associate-*r/N/A

        \[\leadsto \mathsf{fabs.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(eh, \mathsf{sin.f64}\left(t\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(ew, ew\right), \left(\frac{\frac{1}{2} \cdot {\cos t}^{2}}{eh \cdot \sin t}\right)\right)\right)\right) \]
      10. /-lowering-/.f64N/A

        \[\leadsto \mathsf{fabs.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(eh, \mathsf{sin.f64}\left(t\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(ew, ew\right), \mathsf{/.f64}\left(\left(\frac{1}{2} \cdot {\cos t}^{2}\right), \left(eh \cdot \sin t\right)\right)\right)\right)\right) \]
      11. *-lowering-*.f64N/A

        \[\leadsto \mathsf{fabs.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(eh, \mathsf{sin.f64}\left(t\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(ew, ew\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \left({\cos t}^{2}\right)\right), \left(eh \cdot \sin t\right)\right)\right)\right)\right) \]
      12. pow-lowering-pow.f64N/A

        \[\leadsto \mathsf{fabs.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(eh, \mathsf{sin.f64}\left(t\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(ew, ew\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{pow.f64}\left(\cos t, 2\right)\right), \left(eh \cdot \sin t\right)\right)\right)\right)\right) \]
      13. cos-lowering-cos.f64N/A

        \[\leadsto \mathsf{fabs.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(eh, \mathsf{sin.f64}\left(t\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(ew, ew\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{pow.f64}\left(\mathsf{cos.f64}\left(t\right), 2\right)\right), \left(eh \cdot \sin t\right)\right)\right)\right)\right) \]
      14. *-lowering-*.f64N/A

        \[\leadsto \mathsf{fabs.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(eh, \mathsf{sin.f64}\left(t\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(ew, ew\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{pow.f64}\left(\mathsf{cos.f64}\left(t\right), 2\right)\right), \mathsf{*.f64}\left(eh, \sin t\right)\right)\right)\right)\right) \]
      15. sin-lowering-sin.f6475.5%

        \[\leadsto \mathsf{fabs.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(eh, \mathsf{sin.f64}\left(t\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(ew, ew\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{pow.f64}\left(\mathsf{cos.f64}\left(t\right), 2\right)\right), \mathsf{*.f64}\left(eh, \mathsf{sin.f64}\left(t\right)\right)\right)\right)\right)\right) \]
    7. Simplified75.5%

      \[\leadsto \left|\color{blue}{eh \cdot \sin t + \left(ew \cdot ew\right) \cdot \frac{0.5 \cdot {\cos t}^{2}}{eh \cdot \sin t}}\right| \]
    8. Step-by-step derivation
      1. associate-*l*N/A

        \[\leadsto \mathsf{fabs.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(eh, \mathsf{sin.f64}\left(t\right)\right), \left(ew \cdot \left(ew \cdot \frac{\frac{1}{2} \cdot {\cos t}^{2}}{eh \cdot \sin t}\right)\right)\right)\right) \]
      2. *-commutativeN/A

        \[\leadsto \mathsf{fabs.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(eh, \mathsf{sin.f64}\left(t\right)\right), \left(\left(ew \cdot \frac{\frac{1}{2} \cdot {\cos t}^{2}}{eh \cdot \sin t}\right) \cdot ew\right)\right)\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{fabs.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(eh, \mathsf{sin.f64}\left(t\right)\right), \mathsf{*.f64}\left(\left(ew \cdot \frac{\frac{1}{2} \cdot {\cos t}^{2}}{eh \cdot \sin t}\right), ew\right)\right)\right) \]
    9. Applied egg-rr94.9%

      \[\leadsto \left|eh \cdot \sin t + \color{blue}{\left(ew \cdot \left(\left(0.5 + 0.5 \cdot \cos \left(2 \cdot t\right)\right) \cdot \frac{0.5}{eh \cdot \sin t}\right)\right) \cdot ew}\right| \]
  3. Recombined 2 regimes into one program.
  4. Final simplification89.9%

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

Alternative 4: 86.7% accurate, 1.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := eh \cdot \sin t\\ \mathbf{if}\;eh \leq 2.2 \cdot 10^{+217}:\\ \;\;\;\;\left|\frac{ew \cdot \cos t + t\_1 \cdot \frac{eh}{\frac{ew}{\tan t}}}{\mathsf{hypot}\left(1, eh \cdot \frac{\tan t}{ew}\right)}\right|\\ \mathbf{else}:\\ \;\;\;\;\left|t\_1 + ew \cdot \left(ew \cdot \left(\left(0.5 + 0.5 \cdot \cos \left(t \cdot 2\right)\right) \cdot \frac{0.5}{t\_1}\right)\right)\right|\\ \end{array} \end{array} \]
(FPCore (eh ew t)
 :precision binary64
 (let* ((t_1 (* eh (sin t))))
   (if (<= eh 2.2e+217)
     (fabs
      (/
       (+ (* ew (cos t)) (* t_1 (/ eh (/ ew (tan t)))))
       (hypot 1.0 (* eh (/ (tan t) ew)))))
     (fabs
      (+ t_1 (* ew (* ew (* (+ 0.5 (* 0.5 (cos (* t 2.0)))) (/ 0.5 t_1)))))))))
double code(double eh, double ew, double t) {
	double t_1 = eh * sin(t);
	double tmp;
	if (eh <= 2.2e+217) {
		tmp = fabs((((ew * cos(t)) + (t_1 * (eh / (ew / tan(t))))) / hypot(1.0, (eh * (tan(t) / ew)))));
	} else {
		tmp = fabs((t_1 + (ew * (ew * ((0.5 + (0.5 * cos((t * 2.0)))) * (0.5 / t_1))))));
	}
	return tmp;
}
public static double code(double eh, double ew, double t) {
	double t_1 = eh * Math.sin(t);
	double tmp;
	if (eh <= 2.2e+217) {
		tmp = Math.abs((((ew * Math.cos(t)) + (t_1 * (eh / (ew / Math.tan(t))))) / Math.hypot(1.0, (eh * (Math.tan(t) / ew)))));
	} else {
		tmp = Math.abs((t_1 + (ew * (ew * ((0.5 + (0.5 * Math.cos((t * 2.0)))) * (0.5 / t_1))))));
	}
	return tmp;
}
def code(eh, ew, t):
	t_1 = eh * math.sin(t)
	tmp = 0
	if eh <= 2.2e+217:
		tmp = math.fabs((((ew * math.cos(t)) + (t_1 * (eh / (ew / math.tan(t))))) / math.hypot(1.0, (eh * (math.tan(t) / ew)))))
	else:
		tmp = math.fabs((t_1 + (ew * (ew * ((0.5 + (0.5 * math.cos((t * 2.0)))) * (0.5 / t_1))))))
	return tmp
function code(eh, ew, t)
	t_1 = Float64(eh * sin(t))
	tmp = 0.0
	if (eh <= 2.2e+217)
		tmp = abs(Float64(Float64(Float64(ew * cos(t)) + Float64(t_1 * Float64(eh / Float64(ew / tan(t))))) / hypot(1.0, Float64(eh * Float64(tan(t) / ew)))));
	else
		tmp = abs(Float64(t_1 + Float64(ew * Float64(ew * Float64(Float64(0.5 + Float64(0.5 * cos(Float64(t * 2.0)))) * Float64(0.5 / t_1))))));
	end
	return tmp
end
function tmp_2 = code(eh, ew, t)
	t_1 = eh * sin(t);
	tmp = 0.0;
	if (eh <= 2.2e+217)
		tmp = abs((((ew * cos(t)) + (t_1 * (eh / (ew / tan(t))))) / hypot(1.0, (eh * (tan(t) / ew)))));
	else
		tmp = abs((t_1 + (ew * (ew * ((0.5 + (0.5 * cos((t * 2.0)))) * (0.5 / t_1))))));
	end
	tmp_2 = tmp;
end
code[eh_, ew_, t_] := Block[{t$95$1 = N[(eh * N[Sin[t], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[eh, 2.2e+217], N[Abs[N[(N[(N[(ew * N[Cos[t], $MachinePrecision]), $MachinePrecision] + N[(t$95$1 * N[(eh / N[(ew / N[Tan[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sqrt[1.0 ^ 2 + N[(eh * N[(N[Tan[t], $MachinePrecision] / ew), $MachinePrecision]), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Abs[N[(t$95$1 + N[(ew * N[(ew * N[(N[(0.5 + N[(0.5 * N[Cos[N[(t * 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(0.5 / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := eh \cdot \sin t\\
\mathbf{if}\;eh \leq 2.2 \cdot 10^{+217}:\\
\;\;\;\;\left|\frac{ew \cdot \cos t + t\_1 \cdot \frac{eh}{\frac{ew}{\tan t}}}{\mathsf{hypot}\left(1, eh \cdot \frac{\tan t}{ew}\right)}\right|\\

\mathbf{else}:\\
\;\;\;\;\left|t\_1 + ew \cdot \left(ew \cdot \left(\left(0.5 + 0.5 \cdot \cos \left(t \cdot 2\right)\right) \cdot \frac{0.5}{t\_1}\right)\right)\right|\\


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

    1. Initial program 99.8%

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

        \[\leadsto \mathsf{fabs.f64}\left(\left(\left(ew \cdot \cos t\right) \cdot \frac{1}{\sqrt{1 + \frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t}{ew} \cdot \frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t}{ew}}} - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t}{ew}\right)\right)\right) \]
      2. un-div-invN/A

        \[\leadsto \mathsf{fabs.f64}\left(\left(\frac{ew \cdot \cos t}{\sqrt{1 + \frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t}{ew} \cdot \frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t}{ew}}} - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t}{ew}\right)\right)\right) \]
      3. *-commutativeN/A

        \[\leadsto \mathsf{fabs.f64}\left(\left(\frac{ew \cdot \cos t}{\sqrt{1 + \frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t}{ew} \cdot \frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t}{ew}}} - \sin \tan^{-1} \left(\frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t}{ew}\right) \cdot \left(eh \cdot \sin t\right)\right)\right) \]
      4. sin-atanN/A

        \[\leadsto \mathsf{fabs.f64}\left(\left(\frac{ew \cdot \cos t}{\sqrt{1 + \frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t}{ew} \cdot \frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t}{ew}}} - \frac{\frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t}{ew}}{\sqrt{1 + \frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t}{ew} \cdot \frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t}{ew}}} \cdot \left(eh \cdot \sin t\right)\right)\right) \]
      5. associate-*l/N/A

        \[\leadsto \mathsf{fabs.f64}\left(\left(\frac{ew \cdot \cos t}{\sqrt{1 + \frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t}{ew} \cdot \frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t}{ew}}} - \frac{\frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t}{ew} \cdot \left(eh \cdot \sin t\right)}{\sqrt{1 + \frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t}{ew} \cdot \frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t}{ew}}}\right)\right) \]
      6. sub-divN/A

        \[\leadsto \mathsf{fabs.f64}\left(\left(\frac{ew \cdot \cos t - \frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t}{ew} \cdot \left(eh \cdot \sin t\right)}{\sqrt{1 + \frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t}{ew} \cdot \frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t}{ew}}}\right)\right) \]
      7. /-lowering-/.f64N/A

        \[\leadsto \mathsf{fabs.f64}\left(\mathsf{/.f64}\left(\left(ew \cdot \cos t - \frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t}{ew} \cdot \left(eh \cdot \sin t\right)\right), \left(\sqrt{1 + \frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t}{ew} \cdot \frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t}{ew}}\right)\right)\right) \]
    4. Applied egg-rr89.5%

      \[\leadsto \left|\color{blue}{\frac{ew \cdot \cos t - \left(0 - \frac{eh}{\frac{ew}{\tan t}}\right) \cdot \left(eh \cdot \sin t\right)}{\mathsf{hypot}\left(1, 0 - \frac{eh}{\frac{ew}{\tan t}}\right)}}\right| \]
    5. Step-by-step derivation
      1. hypot-undefineN/A

        \[\leadsto \mathsf{fabs.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(ew, \mathsf{cos.f64}\left(t\right)\right), \mathsf{*.f64}\left(\mathsf{\_.f64}\left(0, \mathsf{/.f64}\left(eh, \mathsf{/.f64}\left(ew, \mathsf{tan.f64}\left(t\right)\right)\right)\right), \mathsf{*.f64}\left(eh, \mathsf{sin.f64}\left(t\right)\right)\right)\right), \left(\mathsf{hypot}\left(1, 0 - \frac{eh}{\frac{ew}{\tan t}}\right)\right)\right)\right) \]
      2. div-invN/A

        \[\leadsto \mathsf{fabs.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(ew, \mathsf{cos.f64}\left(t\right)\right), \mathsf{*.f64}\left(\mathsf{\_.f64}\left(0, \mathsf{/.f64}\left(eh, \mathsf{/.f64}\left(ew, \mathsf{tan.f64}\left(t\right)\right)\right)\right), \mathsf{*.f64}\left(eh, \mathsf{sin.f64}\left(t\right)\right)\right)\right), \left(\mathsf{hypot}\left(1, 0 - eh \cdot \frac{1}{\frac{ew}{\tan t}}\right)\right)\right)\right) \]
      3. clear-numN/A

        \[\leadsto \mathsf{fabs.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(ew, \mathsf{cos.f64}\left(t\right)\right), \mathsf{*.f64}\left(\mathsf{\_.f64}\left(0, \mathsf{/.f64}\left(eh, \mathsf{/.f64}\left(ew, \mathsf{tan.f64}\left(t\right)\right)\right)\right), \mathsf{*.f64}\left(eh, \mathsf{sin.f64}\left(t\right)\right)\right)\right), \left(\mathsf{hypot}\left(1, 0 - eh \cdot \frac{\tan t}{ew}\right)\right)\right)\right) \]
      4. cancel-sign-sub-invN/A

        \[\leadsto \mathsf{fabs.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(ew, \mathsf{cos.f64}\left(t\right)\right), \mathsf{*.f64}\left(\mathsf{\_.f64}\left(0, \mathsf{/.f64}\left(eh, \mathsf{/.f64}\left(ew, \mathsf{tan.f64}\left(t\right)\right)\right)\right), \mathsf{*.f64}\left(eh, \mathsf{sin.f64}\left(t\right)\right)\right)\right), \left(\mathsf{hypot}\left(1, 0 + \left(\mathsf{neg}\left(eh\right)\right) \cdot \frac{\tan t}{ew}\right)\right)\right)\right) \]
      5. associate-/l*N/A

        \[\leadsto \mathsf{fabs.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(ew, \mathsf{cos.f64}\left(t\right)\right), \mathsf{*.f64}\left(\mathsf{\_.f64}\left(0, \mathsf{/.f64}\left(eh, \mathsf{/.f64}\left(ew, \mathsf{tan.f64}\left(t\right)\right)\right)\right), \mathsf{*.f64}\left(eh, \mathsf{sin.f64}\left(t\right)\right)\right)\right), \left(\mathsf{hypot}\left(1, 0 + \frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t}{ew}\right)\right)\right)\right) \]
      6. +-lft-identityN/A

        \[\leadsto \mathsf{fabs.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(ew, \mathsf{cos.f64}\left(t\right)\right), \mathsf{*.f64}\left(\mathsf{\_.f64}\left(0, \mathsf{/.f64}\left(eh, \mathsf{/.f64}\left(ew, \mathsf{tan.f64}\left(t\right)\right)\right)\right), \mathsf{*.f64}\left(eh, \mathsf{sin.f64}\left(t\right)\right)\right)\right), \left(\mathsf{hypot}\left(1, \frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t}{ew}\right)\right)\right)\right) \]
      7. hypot-1-defN/A

        \[\leadsto \mathsf{fabs.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(ew, \mathsf{cos.f64}\left(t\right)\right), \mathsf{*.f64}\left(\mathsf{\_.f64}\left(0, \mathsf{/.f64}\left(eh, \mathsf{/.f64}\left(ew, \mathsf{tan.f64}\left(t\right)\right)\right)\right), \mathsf{*.f64}\left(eh, \mathsf{sin.f64}\left(t\right)\right)\right)\right), \left(\sqrt{1 + \frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t}{ew} \cdot \frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t}{ew}}\right)\right)\right) \]
      8. square-defineN/A

        \[\leadsto \mathsf{fabs.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(ew, \mathsf{cos.f64}\left(t\right)\right), \mathsf{*.f64}\left(\mathsf{\_.f64}\left(0, \mathsf{/.f64}\left(eh, \mathsf{/.f64}\left(ew, \mathsf{tan.f64}\left(t\right)\right)\right)\right), \mathsf{*.f64}\left(eh, \mathsf{sin.f64}\left(t\right)\right)\right)\right), \left(\sqrt{1 + \mathsf{square}\left(\left(\frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t}{ew}\right)\right)}\right)\right)\right) \]
      9. +-lft-identityN/A

        \[\leadsto \mathsf{fabs.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(ew, \mathsf{cos.f64}\left(t\right)\right), \mathsf{*.f64}\left(\mathsf{\_.f64}\left(0, \mathsf{/.f64}\left(eh, \mathsf{/.f64}\left(ew, \mathsf{tan.f64}\left(t\right)\right)\right)\right), \mathsf{*.f64}\left(eh, \mathsf{sin.f64}\left(t\right)\right)\right)\right), \left(\sqrt{1 + \mathsf{square}\left(\left(0 + \frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t}{ew}\right)\right)}\right)\right)\right) \]
      10. associate-/l*N/A

        \[\leadsto \mathsf{fabs.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(ew, \mathsf{cos.f64}\left(t\right)\right), \mathsf{*.f64}\left(\mathsf{\_.f64}\left(0, \mathsf{/.f64}\left(eh, \mathsf{/.f64}\left(ew, \mathsf{tan.f64}\left(t\right)\right)\right)\right), \mathsf{*.f64}\left(eh, \mathsf{sin.f64}\left(t\right)\right)\right)\right), \left(\sqrt{1 + \mathsf{square}\left(\left(0 + \left(\mathsf{neg}\left(eh\right)\right) \cdot \frac{\tan t}{ew}\right)\right)}\right)\right)\right) \]
      11. cancel-sign-sub-invN/A

        \[\leadsto \mathsf{fabs.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(ew, \mathsf{cos.f64}\left(t\right)\right), \mathsf{*.f64}\left(\mathsf{\_.f64}\left(0, \mathsf{/.f64}\left(eh, \mathsf{/.f64}\left(ew, \mathsf{tan.f64}\left(t\right)\right)\right)\right), \mathsf{*.f64}\left(eh, \mathsf{sin.f64}\left(t\right)\right)\right)\right), \left(\sqrt{1 + \mathsf{square}\left(\left(0 - eh \cdot \frac{\tan t}{ew}\right)\right)}\right)\right)\right) \]
      12. clear-numN/A

        \[\leadsto \mathsf{fabs.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(ew, \mathsf{cos.f64}\left(t\right)\right), \mathsf{*.f64}\left(\mathsf{\_.f64}\left(0, \mathsf{/.f64}\left(eh, \mathsf{/.f64}\left(ew, \mathsf{tan.f64}\left(t\right)\right)\right)\right), \mathsf{*.f64}\left(eh, \mathsf{sin.f64}\left(t\right)\right)\right)\right), \left(\sqrt{1 + \mathsf{square}\left(\left(0 - eh \cdot \frac{1}{\frac{ew}{\tan t}}\right)\right)}\right)\right)\right) \]
      13. div-invN/A

        \[\leadsto \mathsf{fabs.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(ew, \mathsf{cos.f64}\left(t\right)\right), \mathsf{*.f64}\left(\mathsf{\_.f64}\left(0, \mathsf{/.f64}\left(eh, \mathsf{/.f64}\left(ew, \mathsf{tan.f64}\left(t\right)\right)\right)\right), \mathsf{*.f64}\left(eh, \mathsf{sin.f64}\left(t\right)\right)\right)\right), \left(\sqrt{1 + \mathsf{square}\left(\left(0 - \frac{eh}{\frac{ew}{\tan t}}\right)\right)}\right)\right)\right) \]
      14. square-defineN/A

        \[\leadsto \mathsf{fabs.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(ew, \mathsf{cos.f64}\left(t\right)\right), \mathsf{*.f64}\left(\mathsf{\_.f64}\left(0, \mathsf{/.f64}\left(eh, \mathsf{/.f64}\left(ew, \mathsf{tan.f64}\left(t\right)\right)\right)\right), \mathsf{*.f64}\left(eh, \mathsf{sin.f64}\left(t\right)\right)\right)\right), \left(\sqrt{1 + \left(0 - \frac{eh}{\frac{ew}{\tan t}}\right) \cdot \left(0 - \frac{eh}{\frac{ew}{\tan t}}\right)}\right)\right)\right) \]
    6. Applied egg-rr89.4%

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

    if 2.2e217 < eh

    1. Initial program 99.8%

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

        \[\leadsto \mathsf{fabs.f64}\left(\left(\left(ew \cdot \cos t\right) \cdot \frac{1}{\sqrt{1 + \frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t}{ew} \cdot \frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t}{ew}}} - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t}{ew}\right)\right)\right) \]
      2. un-div-invN/A

        \[\leadsto \mathsf{fabs.f64}\left(\left(\frac{ew \cdot \cos t}{\sqrt{1 + \frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t}{ew} \cdot \frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t}{ew}}} - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t}{ew}\right)\right)\right) \]
      3. *-commutativeN/A

        \[\leadsto \mathsf{fabs.f64}\left(\left(\frac{ew \cdot \cos t}{\sqrt{1 + \frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t}{ew} \cdot \frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t}{ew}}} - \sin \tan^{-1} \left(\frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t}{ew}\right) \cdot \left(eh \cdot \sin t\right)\right)\right) \]
      4. sin-atanN/A

        \[\leadsto \mathsf{fabs.f64}\left(\left(\frac{ew \cdot \cos t}{\sqrt{1 + \frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t}{ew} \cdot \frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t}{ew}}} - \frac{\frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t}{ew}}{\sqrt{1 + \frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t}{ew} \cdot \frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t}{ew}}} \cdot \left(eh \cdot \sin t\right)\right)\right) \]
      5. associate-*l/N/A

        \[\leadsto \mathsf{fabs.f64}\left(\left(\frac{ew \cdot \cos t}{\sqrt{1 + \frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t}{ew} \cdot \frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t}{ew}}} - \frac{\frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t}{ew} \cdot \left(eh \cdot \sin t\right)}{\sqrt{1 + \frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t}{ew} \cdot \frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t}{ew}}}\right)\right) \]
      6. sub-divN/A

        \[\leadsto \mathsf{fabs.f64}\left(\left(\frac{ew \cdot \cos t - \frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t}{ew} \cdot \left(eh \cdot \sin t\right)}{\sqrt{1 + \frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t}{ew} \cdot \frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t}{ew}}}\right)\right) \]
      7. /-lowering-/.f64N/A

        \[\leadsto \mathsf{fabs.f64}\left(\mathsf{/.f64}\left(\left(ew \cdot \cos t - \frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t}{ew} \cdot \left(eh \cdot \sin t\right)\right), \left(\sqrt{1 + \frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t}{ew} \cdot \frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t}{ew}}\right)\right)\right) \]
    4. Applied egg-rr39.5%

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

      \[\leadsto \mathsf{fabs.f64}\left(\color{blue}{\left(eh \cdot \sin t + {ew}^{2} \cdot \left(\frac{-1}{2} \cdot \frac{{\cos t}^{2}}{eh \cdot \sin t} + \frac{{\cos t}^{2}}{eh \cdot \sin t}\right)\right)}\right) \]
    6. Step-by-step derivation
      1. distribute-lft1-inN/A

        \[\leadsto \mathsf{fabs.f64}\left(\left(eh \cdot \sin t + {ew}^{2} \cdot \left(\left(\frac{-1}{2} + 1\right) \cdot \frac{{\cos t}^{2}}{eh \cdot \sin t}\right)\right)\right) \]
      2. metadata-evalN/A

        \[\leadsto \mathsf{fabs.f64}\left(\left(eh \cdot \sin t + {ew}^{2} \cdot \left(\frac{1}{2} \cdot \frac{{\cos t}^{2}}{eh \cdot \sin t}\right)\right)\right) \]
      3. +-lowering-+.f64N/A

        \[\leadsto \mathsf{fabs.f64}\left(\mathsf{+.f64}\left(\left(eh \cdot \sin t\right), \left({ew}^{2} \cdot \left(\frac{1}{2} \cdot \frac{{\cos t}^{2}}{eh \cdot \sin t}\right)\right)\right)\right) \]
      4. *-lowering-*.f64N/A

        \[\leadsto \mathsf{fabs.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(eh, \sin t\right), \left({ew}^{2} \cdot \left(\frac{1}{2} \cdot \frac{{\cos t}^{2}}{eh \cdot \sin t}\right)\right)\right)\right) \]
      5. sin-lowering-sin.f64N/A

        \[\leadsto \mathsf{fabs.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(eh, \mathsf{sin.f64}\left(t\right)\right), \left({ew}^{2} \cdot \left(\frac{1}{2} \cdot \frac{{\cos t}^{2}}{eh \cdot \sin t}\right)\right)\right)\right) \]
      6. *-lowering-*.f64N/A

        \[\leadsto \mathsf{fabs.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(eh, \mathsf{sin.f64}\left(t\right)\right), \mathsf{*.f64}\left(\left({ew}^{2}\right), \left(\frac{1}{2} \cdot \frac{{\cos t}^{2}}{eh \cdot \sin t}\right)\right)\right)\right) \]
      7. unpow2N/A

        \[\leadsto \mathsf{fabs.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(eh, \mathsf{sin.f64}\left(t\right)\right), \mathsf{*.f64}\left(\left(ew \cdot ew\right), \left(\frac{1}{2} \cdot \frac{{\cos t}^{2}}{eh \cdot \sin t}\right)\right)\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{fabs.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(eh, \mathsf{sin.f64}\left(t\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(ew, ew\right), \left(\frac{1}{2} \cdot \frac{{\cos t}^{2}}{eh \cdot \sin t}\right)\right)\right)\right) \]
      9. associate-*r/N/A

        \[\leadsto \mathsf{fabs.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(eh, \mathsf{sin.f64}\left(t\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(ew, ew\right), \left(\frac{\frac{1}{2} \cdot {\cos t}^{2}}{eh \cdot \sin t}\right)\right)\right)\right) \]
      10. /-lowering-/.f64N/A

        \[\leadsto \mathsf{fabs.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(eh, \mathsf{sin.f64}\left(t\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(ew, ew\right), \mathsf{/.f64}\left(\left(\frac{1}{2} \cdot {\cos t}^{2}\right), \left(eh \cdot \sin t\right)\right)\right)\right)\right) \]
      11. *-lowering-*.f64N/A

        \[\leadsto \mathsf{fabs.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(eh, \mathsf{sin.f64}\left(t\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(ew, ew\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \left({\cos t}^{2}\right)\right), \left(eh \cdot \sin t\right)\right)\right)\right)\right) \]
      12. pow-lowering-pow.f64N/A

        \[\leadsto \mathsf{fabs.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(eh, \mathsf{sin.f64}\left(t\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(ew, ew\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{pow.f64}\left(\cos t, 2\right)\right), \left(eh \cdot \sin t\right)\right)\right)\right)\right) \]
      13. cos-lowering-cos.f64N/A

        \[\leadsto \mathsf{fabs.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(eh, \mathsf{sin.f64}\left(t\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(ew, ew\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{pow.f64}\left(\mathsf{cos.f64}\left(t\right), 2\right)\right), \left(eh \cdot \sin t\right)\right)\right)\right)\right) \]
      14. *-lowering-*.f64N/A

        \[\leadsto \mathsf{fabs.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(eh, \mathsf{sin.f64}\left(t\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(ew, ew\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{pow.f64}\left(\mathsf{cos.f64}\left(t\right), 2\right)\right), \mathsf{*.f64}\left(eh, \sin t\right)\right)\right)\right)\right) \]
      15. sin-lowering-sin.f6475.5%

        \[\leadsto \mathsf{fabs.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(eh, \mathsf{sin.f64}\left(t\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(ew, ew\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{pow.f64}\left(\mathsf{cos.f64}\left(t\right), 2\right)\right), \mathsf{*.f64}\left(eh, \mathsf{sin.f64}\left(t\right)\right)\right)\right)\right)\right) \]
    7. Simplified75.5%

      \[\leadsto \left|\color{blue}{eh \cdot \sin t + \left(ew \cdot ew\right) \cdot \frac{0.5 \cdot {\cos t}^{2}}{eh \cdot \sin t}}\right| \]
    8. Step-by-step derivation
      1. associate-*l*N/A

        \[\leadsto \mathsf{fabs.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(eh, \mathsf{sin.f64}\left(t\right)\right), \left(ew \cdot \left(ew \cdot \frac{\frac{1}{2} \cdot {\cos t}^{2}}{eh \cdot \sin t}\right)\right)\right)\right) \]
      2. *-commutativeN/A

        \[\leadsto \mathsf{fabs.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(eh, \mathsf{sin.f64}\left(t\right)\right), \left(\left(ew \cdot \frac{\frac{1}{2} \cdot {\cos t}^{2}}{eh \cdot \sin t}\right) \cdot ew\right)\right)\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{fabs.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(eh, \mathsf{sin.f64}\left(t\right)\right), \mathsf{*.f64}\left(\left(ew \cdot \frac{\frac{1}{2} \cdot {\cos t}^{2}}{eh \cdot \sin t}\right), ew\right)\right)\right) \]
    9. Applied egg-rr94.9%

      \[\leadsto \left|eh \cdot \sin t + \color{blue}{\left(ew \cdot \left(\left(0.5 + 0.5 \cdot \cos \left(2 \cdot t\right)\right) \cdot \frac{0.5}{eh \cdot \sin t}\right)\right) \cdot ew}\right| \]
  3. Recombined 2 regimes into one program.
  4. Final simplification89.8%

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

Alternative 5: 76.1% accurate, 4.3× speedup?

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

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

\mathbf{elif}\;ew \leq 5.8 \cdot 10^{-66}:\\
\;\;\;\;\left|eh \cdot \sin t\right|\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if ew < -7.7999999999999997e-81 or 5.80000000000000023e-66 < ew

    1. Initial program 99.8%

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

        \[\leadsto \mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(\left(\left(ew \cdot \cos t\right) \cdot \frac{1}{\sqrt{1 + \frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t}{ew} \cdot \frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t}{ew}}}\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(eh, \mathsf{sin.f64}\left(t\right)\right), \mathsf{sin.f64}\left(\mathsf{atan.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{neg.f64}\left(eh\right), \mathsf{tan.f64}\left(t\right)\right), ew\right)\right)\right)\right)\right)\right) \]
      2. un-div-invN/A

        \[\leadsto \mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(\left(\frac{ew \cdot \cos t}{\sqrt{1 + \frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t}{ew} \cdot \frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t}{ew}}}\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(eh, \mathsf{sin.f64}\left(t\right)\right), \mathsf{sin.f64}\left(\mathsf{atan.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{neg.f64}\left(eh\right), \mathsf{tan.f64}\left(t\right)\right), ew\right)\right)\right)\right)\right)\right) \]
      3. /-lowering-/.f64N/A

        \[\leadsto \mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(\left(ew \cdot \cos t\right), \left(\sqrt{1 + \frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t}{ew} \cdot \frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t}{ew}}\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(eh, \mathsf{sin.f64}\left(t\right)\right), \mathsf{sin.f64}\left(\mathsf{atan.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{neg.f64}\left(eh\right), \mathsf{tan.f64}\left(t\right)\right), ew\right)\right)\right)\right)\right)\right) \]
      4. *-lowering-*.f64N/A

        \[\leadsto \mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(ew, \cos t\right), \left(\sqrt{1 + \frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t}{ew} \cdot \frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t}{ew}}\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(eh, \mathsf{sin.f64}\left(t\right)\right), \mathsf{sin.f64}\left(\mathsf{atan.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{neg.f64}\left(eh\right), \mathsf{tan.f64}\left(t\right)\right), ew\right)\right)\right)\right)\right)\right) \]
      5. cos-lowering-cos.f64N/A

        \[\leadsto \mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(ew, \mathsf{cos.f64}\left(t\right)\right), \left(\sqrt{1 + \frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t}{ew} \cdot \frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t}{ew}}\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(eh, \mathsf{sin.f64}\left(t\right)\right), \mathsf{sin.f64}\left(\mathsf{atan.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{neg.f64}\left(eh\right), \mathsf{tan.f64}\left(t\right)\right), ew\right)\right)\right)\right)\right)\right) \]
      6. hypot-1-defN/A

        \[\leadsto \mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(ew, \mathsf{cos.f64}\left(t\right)\right), \left(\mathsf{hypot}\left(1, \frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t}{ew}\right)\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(eh, \mathsf{sin.f64}\left(t\right)\right), \mathsf{sin.f64}\left(\mathsf{atan.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{neg.f64}\left(eh\right), \mathsf{tan.f64}\left(t\right)\right), ew\right)\right)\right)\right)\right)\right) \]
      7. hypot-lowering-hypot.f64N/A

        \[\leadsto \mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(ew, \mathsf{cos.f64}\left(t\right)\right), \mathsf{hypot.f64}\left(1, \left(\frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t}{ew}\right)\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(eh, \mathsf{sin.f64}\left(t\right)\right), \mathsf{sin.f64}\left(\mathsf{atan.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{neg.f64}\left(eh\right), \mathsf{tan.f64}\left(t\right)\right), ew\right)\right)\right)\right)\right)\right) \]
      8. associate-/l*N/A

        \[\leadsto \mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(ew, \mathsf{cos.f64}\left(t\right)\right), \mathsf{hypot.f64}\left(1, \left(\left(\mathsf{neg}\left(eh\right)\right) \cdot \frac{\tan t}{ew}\right)\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(eh, \mathsf{sin.f64}\left(t\right)\right), \mathsf{sin.f64}\left(\mathsf{atan.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{neg.f64}\left(eh\right), \mathsf{tan.f64}\left(t\right)\right), ew\right)\right)\right)\right)\right)\right) \]
      9. distribute-lft-neg-outN/A

        \[\leadsto \mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(ew, \mathsf{cos.f64}\left(t\right)\right), \mathsf{hypot.f64}\left(1, \left(\mathsf{neg}\left(eh \cdot \frac{\tan t}{ew}\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(eh, \mathsf{sin.f64}\left(t\right)\right), \mathsf{sin.f64}\left(\mathsf{atan.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{neg.f64}\left(eh\right), \mathsf{tan.f64}\left(t\right)\right), ew\right)\right)\right)\right)\right)\right) \]
      10. neg-sub0N/A

        \[\leadsto \mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(ew, \mathsf{cos.f64}\left(t\right)\right), \mathsf{hypot.f64}\left(1, \left(0 - eh \cdot \frac{\tan t}{ew}\right)\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(eh, \mathsf{sin.f64}\left(t\right)\right), \mathsf{sin.f64}\left(\mathsf{atan.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{neg.f64}\left(eh\right), \mathsf{tan.f64}\left(t\right)\right), ew\right)\right)\right)\right)\right)\right) \]
      11. remove-double-negN/A

        \[\leadsto \mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(ew, \mathsf{cos.f64}\left(t\right)\right), \mathsf{hypot.f64}\left(1, \left(0 - \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(eh \cdot \frac{\tan t}{ew}\right)\right)\right)\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(eh, \mathsf{sin.f64}\left(t\right)\right), \mathsf{sin.f64}\left(\mathsf{atan.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{neg.f64}\left(eh\right), \mathsf{tan.f64}\left(t\right)\right), ew\right)\right)\right)\right)\right)\right) \]
      12. distribute-lft-neg-outN/A

        \[\leadsto \mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(ew, \mathsf{cos.f64}\left(t\right)\right), \mathsf{hypot.f64}\left(1, \left(0 - \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(eh\right)\right) \cdot \frac{\tan t}{ew}\right)\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(eh, \mathsf{sin.f64}\left(t\right)\right), \mathsf{sin.f64}\left(\mathsf{atan.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{neg.f64}\left(eh\right), \mathsf{tan.f64}\left(t\right)\right), ew\right)\right)\right)\right)\right)\right) \]
      13. associate-/l*N/A

        \[\leadsto \mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(ew, \mathsf{cos.f64}\left(t\right)\right), \mathsf{hypot.f64}\left(1, \left(0 - \left(\mathsf{neg}\left(\frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t}{ew}\right)\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(eh, \mathsf{sin.f64}\left(t\right)\right), \mathsf{sin.f64}\left(\mathsf{atan.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{neg.f64}\left(eh\right), \mathsf{tan.f64}\left(t\right)\right), ew\right)\right)\right)\right)\right)\right) \]
      14. --lowering--.f64N/A

        \[\leadsto \mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(ew, \mathsf{cos.f64}\left(t\right)\right), \mathsf{hypot.f64}\left(1, \mathsf{\_.f64}\left(0, \left(\mathsf{neg}\left(\frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t}{ew}\right)\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(eh, \mathsf{sin.f64}\left(t\right)\right), \mathsf{sin.f64}\left(\mathsf{atan.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{neg.f64}\left(eh\right), \mathsf{tan.f64}\left(t\right)\right), ew\right)\right)\right)\right)\right)\right) \]
      15. associate-/l*N/A

        \[\leadsto \mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(ew, \mathsf{cos.f64}\left(t\right)\right), \mathsf{hypot.f64}\left(1, \mathsf{\_.f64}\left(0, \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(eh\right)\right) \cdot \frac{\tan t}{ew}\right)\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(eh, \mathsf{sin.f64}\left(t\right)\right), \mathsf{sin.f64}\left(\mathsf{atan.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{neg.f64}\left(eh\right), \mathsf{tan.f64}\left(t\right)\right), ew\right)\right)\right)\right)\right)\right) \]
      16. distribute-lft-neg-outN/A

        \[\leadsto \mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(ew, \mathsf{cos.f64}\left(t\right)\right), \mathsf{hypot.f64}\left(1, \mathsf{\_.f64}\left(0, \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(eh \cdot \frac{\tan t}{ew}\right)\right)\right)\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(eh, \mathsf{sin.f64}\left(t\right)\right), \mathsf{sin.f64}\left(\mathsf{atan.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{neg.f64}\left(eh\right), \mathsf{tan.f64}\left(t\right)\right), ew\right)\right)\right)\right)\right)\right) \]
      17. remove-double-negN/A

        \[\leadsto \mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(ew, \mathsf{cos.f64}\left(t\right)\right), \mathsf{hypot.f64}\left(1, \mathsf{\_.f64}\left(0, \left(eh \cdot \frac{\tan t}{ew}\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(eh, \mathsf{sin.f64}\left(t\right)\right), \mathsf{sin.f64}\left(\mathsf{atan.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{neg.f64}\left(eh\right), \mathsf{tan.f64}\left(t\right)\right), ew\right)\right)\right)\right)\right)\right) \]
      18. clear-numN/A

        \[\leadsto \mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(ew, \mathsf{cos.f64}\left(t\right)\right), \mathsf{hypot.f64}\left(1, \mathsf{\_.f64}\left(0, \left(eh \cdot \frac{1}{\frac{ew}{\tan t}}\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(eh, \mathsf{sin.f64}\left(t\right)\right), \mathsf{sin.f64}\left(\mathsf{atan.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{neg.f64}\left(eh\right), \mathsf{tan.f64}\left(t\right)\right), ew\right)\right)\right)\right)\right)\right) \]
    4. Applied egg-rr99.8%

      \[\leadsto \left|\color{blue}{\frac{ew \cdot \cos t}{\mathsf{hypot}\left(1, 0 - \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. Taylor expanded in ew around inf

      \[\leadsto \mathsf{fabs.f64}\left(\color{blue}{\left(ew \cdot \cos t\right)}\right) \]
    6. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{fabs.f64}\left(\mathsf{*.f64}\left(ew, \cos t\right)\right) \]
      2. cos-lowering-cos.f6482.6%

        \[\leadsto \mathsf{fabs.f64}\left(\mathsf{*.f64}\left(ew, \mathsf{cos.f64}\left(t\right)\right)\right) \]
    7. Simplified82.6%

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

    if -7.7999999999999997e-81 < ew < 5.80000000000000023e-66

    1. Initial program 99.8%

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

        \[\leadsto \mathsf{fabs.f64}\left(\left(\left(ew \cdot \cos t\right) \cdot \frac{1}{\sqrt{1 + \frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t}{ew} \cdot \frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t}{ew}}} - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t}{ew}\right)\right)\right) \]
      2. un-div-invN/A

        \[\leadsto \mathsf{fabs.f64}\left(\left(\frac{ew \cdot \cos t}{\sqrt{1 + \frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t}{ew} \cdot \frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t}{ew}}} - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t}{ew}\right)\right)\right) \]
      3. *-commutativeN/A

        \[\leadsto \mathsf{fabs.f64}\left(\left(\frac{ew \cdot \cos t}{\sqrt{1 + \frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t}{ew} \cdot \frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t}{ew}}} - \sin \tan^{-1} \left(\frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t}{ew}\right) \cdot \left(eh \cdot \sin t\right)\right)\right) \]
      4. sin-atanN/A

        \[\leadsto \mathsf{fabs.f64}\left(\left(\frac{ew \cdot \cos t}{\sqrt{1 + \frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t}{ew} \cdot \frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t}{ew}}} - \frac{\frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t}{ew}}{\sqrt{1 + \frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t}{ew} \cdot \frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t}{ew}}} \cdot \left(eh \cdot \sin t\right)\right)\right) \]
      5. associate-*l/N/A

        \[\leadsto \mathsf{fabs.f64}\left(\left(\frac{ew \cdot \cos t}{\sqrt{1 + \frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t}{ew} \cdot \frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t}{ew}}} - \frac{\frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t}{ew} \cdot \left(eh \cdot \sin t\right)}{\sqrt{1 + \frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t}{ew} \cdot \frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t}{ew}}}\right)\right) \]
      6. sub-divN/A

        \[\leadsto \mathsf{fabs.f64}\left(\left(\frac{ew \cdot \cos t - \frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t}{ew} \cdot \left(eh \cdot \sin t\right)}{\sqrt{1 + \frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t}{ew} \cdot \frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t}{ew}}}\right)\right) \]
      7. /-lowering-/.f64N/A

        \[\leadsto \mathsf{fabs.f64}\left(\mathsf{/.f64}\left(\left(ew \cdot \cos t - \frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t}{ew} \cdot \left(eh \cdot \sin t\right)\right), \left(\sqrt{1 + \frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t}{ew} \cdot \frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t}{ew}}\right)\right)\right) \]
    4. Applied egg-rr65.4%

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

      \[\leadsto \mathsf{fabs.f64}\left(\color{blue}{\left(eh \cdot \sin t\right)}\right) \]
    6. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{fabs.f64}\left(\mathsf{*.f64}\left(eh, \sin t\right)\right) \]
      2. sin-lowering-sin.f6471.6%

        \[\leadsto \mathsf{fabs.f64}\left(\mathsf{*.f64}\left(eh, \mathsf{sin.f64}\left(t\right)\right)\right) \]
    7. Simplified71.6%

      \[\leadsto \left|\color{blue}{eh \cdot \sin t}\right| \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 6: 58.5% accurate, 4.3× speedup?

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

\\
\begin{array}{l}
t_1 := \left|eh \cdot \sin t\right|\\
\mathbf{if}\;eh \leq -3.6 \cdot 10^{-57}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;eh \leq 3 \cdot 10^{+49}:\\
\;\;\;\;\left|ew\right|\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if eh < -3.6000000000000002e-57 or 3.0000000000000002e49 < eh

    1. Initial program 99.8%

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

        \[\leadsto \mathsf{fabs.f64}\left(\left(\left(ew \cdot \cos t\right) \cdot \frac{1}{\sqrt{1 + \frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t}{ew} \cdot \frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t}{ew}}} - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t}{ew}\right)\right)\right) \]
      2. un-div-invN/A

        \[\leadsto \mathsf{fabs.f64}\left(\left(\frac{ew \cdot \cos t}{\sqrt{1 + \frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t}{ew} \cdot \frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t}{ew}}} - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t}{ew}\right)\right)\right) \]
      3. *-commutativeN/A

        \[\leadsto \mathsf{fabs.f64}\left(\left(\frac{ew \cdot \cos t}{\sqrt{1 + \frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t}{ew} \cdot \frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t}{ew}}} - \sin \tan^{-1} \left(\frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t}{ew}\right) \cdot \left(eh \cdot \sin t\right)\right)\right) \]
      4. sin-atanN/A

        \[\leadsto \mathsf{fabs.f64}\left(\left(\frac{ew \cdot \cos t}{\sqrt{1 + \frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t}{ew} \cdot \frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t}{ew}}} - \frac{\frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t}{ew}}{\sqrt{1 + \frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t}{ew} \cdot \frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t}{ew}}} \cdot \left(eh \cdot \sin t\right)\right)\right) \]
      5. associate-*l/N/A

        \[\leadsto \mathsf{fabs.f64}\left(\left(\frac{ew \cdot \cos t}{\sqrt{1 + \frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t}{ew} \cdot \frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t}{ew}}} - \frac{\frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t}{ew} \cdot \left(eh \cdot \sin t\right)}{\sqrt{1 + \frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t}{ew} \cdot \frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t}{ew}}}\right)\right) \]
      6. sub-divN/A

        \[\leadsto \mathsf{fabs.f64}\left(\left(\frac{ew \cdot \cos t - \frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t}{ew} \cdot \left(eh \cdot \sin t\right)}{\sqrt{1 + \frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t}{ew} \cdot \frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t}{ew}}}\right)\right) \]
      7. /-lowering-/.f64N/A

        \[\leadsto \mathsf{fabs.f64}\left(\mathsf{/.f64}\left(\left(ew \cdot \cos t - \frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t}{ew} \cdot \left(eh \cdot \sin t\right)\right), \left(\sqrt{1 + \frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t}{ew} \cdot \frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t}{ew}}\right)\right)\right) \]
    4. Applied egg-rr71.2%

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

      \[\leadsto \mathsf{fabs.f64}\left(\color{blue}{\left(eh \cdot \sin t\right)}\right) \]
    6. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{fabs.f64}\left(\mathsf{*.f64}\left(eh, \sin t\right)\right) \]
      2. sin-lowering-sin.f6462.8%

        \[\leadsto \mathsf{fabs.f64}\left(\mathsf{*.f64}\left(eh, \mathsf{sin.f64}\left(t\right)\right)\right) \]
    7. Simplified62.8%

      \[\leadsto \left|\color{blue}{eh \cdot \sin t}\right| \]

    if -3.6000000000000002e-57 < eh < 3.0000000000000002e49

    1. Initial program 99.9%

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

        \[\leadsto \mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(\left(\left(ew \cdot \cos t\right) \cdot \frac{1}{\sqrt{1 + \frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t}{ew} \cdot \frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t}{ew}}}\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(eh, \mathsf{sin.f64}\left(t\right)\right), \mathsf{sin.f64}\left(\mathsf{atan.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{neg.f64}\left(eh\right), \mathsf{tan.f64}\left(t\right)\right), ew\right)\right)\right)\right)\right)\right) \]
      2. un-div-invN/A

        \[\leadsto \mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(\left(\frac{ew \cdot \cos t}{\sqrt{1 + \frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t}{ew} \cdot \frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t}{ew}}}\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(eh, \mathsf{sin.f64}\left(t\right)\right), \mathsf{sin.f64}\left(\mathsf{atan.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{neg.f64}\left(eh\right), \mathsf{tan.f64}\left(t\right)\right), ew\right)\right)\right)\right)\right)\right) \]
      3. /-lowering-/.f64N/A

        \[\leadsto \mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(\left(ew \cdot \cos t\right), \left(\sqrt{1 + \frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t}{ew} \cdot \frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t}{ew}}\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(eh, \mathsf{sin.f64}\left(t\right)\right), \mathsf{sin.f64}\left(\mathsf{atan.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{neg.f64}\left(eh\right), \mathsf{tan.f64}\left(t\right)\right), ew\right)\right)\right)\right)\right)\right) \]
      4. *-lowering-*.f64N/A

        \[\leadsto \mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(ew, \cos t\right), \left(\sqrt{1 + \frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t}{ew} \cdot \frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t}{ew}}\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(eh, \mathsf{sin.f64}\left(t\right)\right), \mathsf{sin.f64}\left(\mathsf{atan.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{neg.f64}\left(eh\right), \mathsf{tan.f64}\left(t\right)\right), ew\right)\right)\right)\right)\right)\right) \]
      5. cos-lowering-cos.f64N/A

        \[\leadsto \mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(ew, \mathsf{cos.f64}\left(t\right)\right), \left(\sqrt{1 + \frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t}{ew} \cdot \frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t}{ew}}\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(eh, \mathsf{sin.f64}\left(t\right)\right), \mathsf{sin.f64}\left(\mathsf{atan.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{neg.f64}\left(eh\right), \mathsf{tan.f64}\left(t\right)\right), ew\right)\right)\right)\right)\right)\right) \]
      6. hypot-1-defN/A

        \[\leadsto \mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(ew, \mathsf{cos.f64}\left(t\right)\right), \left(\mathsf{hypot}\left(1, \frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t}{ew}\right)\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(eh, \mathsf{sin.f64}\left(t\right)\right), \mathsf{sin.f64}\left(\mathsf{atan.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{neg.f64}\left(eh\right), \mathsf{tan.f64}\left(t\right)\right), ew\right)\right)\right)\right)\right)\right) \]
      7. hypot-lowering-hypot.f64N/A

        \[\leadsto \mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(ew, \mathsf{cos.f64}\left(t\right)\right), \mathsf{hypot.f64}\left(1, \left(\frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t}{ew}\right)\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(eh, \mathsf{sin.f64}\left(t\right)\right), \mathsf{sin.f64}\left(\mathsf{atan.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{neg.f64}\left(eh\right), \mathsf{tan.f64}\left(t\right)\right), ew\right)\right)\right)\right)\right)\right) \]
      8. associate-/l*N/A

        \[\leadsto \mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(ew, \mathsf{cos.f64}\left(t\right)\right), \mathsf{hypot.f64}\left(1, \left(\left(\mathsf{neg}\left(eh\right)\right) \cdot \frac{\tan t}{ew}\right)\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(eh, \mathsf{sin.f64}\left(t\right)\right), \mathsf{sin.f64}\left(\mathsf{atan.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{neg.f64}\left(eh\right), \mathsf{tan.f64}\left(t\right)\right), ew\right)\right)\right)\right)\right)\right) \]
      9. distribute-lft-neg-outN/A

        \[\leadsto \mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(ew, \mathsf{cos.f64}\left(t\right)\right), \mathsf{hypot.f64}\left(1, \left(\mathsf{neg}\left(eh \cdot \frac{\tan t}{ew}\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(eh, \mathsf{sin.f64}\left(t\right)\right), \mathsf{sin.f64}\left(\mathsf{atan.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{neg.f64}\left(eh\right), \mathsf{tan.f64}\left(t\right)\right), ew\right)\right)\right)\right)\right)\right) \]
      10. neg-sub0N/A

        \[\leadsto \mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(ew, \mathsf{cos.f64}\left(t\right)\right), \mathsf{hypot.f64}\left(1, \left(0 - eh \cdot \frac{\tan t}{ew}\right)\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(eh, \mathsf{sin.f64}\left(t\right)\right), \mathsf{sin.f64}\left(\mathsf{atan.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{neg.f64}\left(eh\right), \mathsf{tan.f64}\left(t\right)\right), ew\right)\right)\right)\right)\right)\right) \]
      11. remove-double-negN/A

        \[\leadsto \mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(ew, \mathsf{cos.f64}\left(t\right)\right), \mathsf{hypot.f64}\left(1, \left(0 - \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(eh \cdot \frac{\tan t}{ew}\right)\right)\right)\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(eh, \mathsf{sin.f64}\left(t\right)\right), \mathsf{sin.f64}\left(\mathsf{atan.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{neg.f64}\left(eh\right), \mathsf{tan.f64}\left(t\right)\right), ew\right)\right)\right)\right)\right)\right) \]
      12. distribute-lft-neg-outN/A

        \[\leadsto \mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(ew, \mathsf{cos.f64}\left(t\right)\right), \mathsf{hypot.f64}\left(1, \left(0 - \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(eh\right)\right) \cdot \frac{\tan t}{ew}\right)\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(eh, \mathsf{sin.f64}\left(t\right)\right), \mathsf{sin.f64}\left(\mathsf{atan.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{neg.f64}\left(eh\right), \mathsf{tan.f64}\left(t\right)\right), ew\right)\right)\right)\right)\right)\right) \]
      13. associate-/l*N/A

        \[\leadsto \mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(ew, \mathsf{cos.f64}\left(t\right)\right), \mathsf{hypot.f64}\left(1, \left(0 - \left(\mathsf{neg}\left(\frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t}{ew}\right)\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(eh, \mathsf{sin.f64}\left(t\right)\right), \mathsf{sin.f64}\left(\mathsf{atan.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{neg.f64}\left(eh\right), \mathsf{tan.f64}\left(t\right)\right), ew\right)\right)\right)\right)\right)\right) \]
      14. --lowering--.f64N/A

        \[\leadsto \mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(ew, \mathsf{cos.f64}\left(t\right)\right), \mathsf{hypot.f64}\left(1, \mathsf{\_.f64}\left(0, \left(\mathsf{neg}\left(\frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t}{ew}\right)\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(eh, \mathsf{sin.f64}\left(t\right)\right), \mathsf{sin.f64}\left(\mathsf{atan.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{neg.f64}\left(eh\right), \mathsf{tan.f64}\left(t\right)\right), ew\right)\right)\right)\right)\right)\right) \]
      15. associate-/l*N/A

        \[\leadsto \mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(ew, \mathsf{cos.f64}\left(t\right)\right), \mathsf{hypot.f64}\left(1, \mathsf{\_.f64}\left(0, \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(eh\right)\right) \cdot \frac{\tan t}{ew}\right)\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(eh, \mathsf{sin.f64}\left(t\right)\right), \mathsf{sin.f64}\left(\mathsf{atan.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{neg.f64}\left(eh\right), \mathsf{tan.f64}\left(t\right)\right), ew\right)\right)\right)\right)\right)\right) \]
      16. distribute-lft-neg-outN/A

        \[\leadsto \mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(ew, \mathsf{cos.f64}\left(t\right)\right), \mathsf{hypot.f64}\left(1, \mathsf{\_.f64}\left(0, \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(eh \cdot \frac{\tan t}{ew}\right)\right)\right)\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(eh, \mathsf{sin.f64}\left(t\right)\right), \mathsf{sin.f64}\left(\mathsf{atan.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{neg.f64}\left(eh\right), \mathsf{tan.f64}\left(t\right)\right), ew\right)\right)\right)\right)\right)\right) \]
      17. remove-double-negN/A

        \[\leadsto \mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(ew, \mathsf{cos.f64}\left(t\right)\right), \mathsf{hypot.f64}\left(1, \mathsf{\_.f64}\left(0, \left(eh \cdot \frac{\tan t}{ew}\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(eh, \mathsf{sin.f64}\left(t\right)\right), \mathsf{sin.f64}\left(\mathsf{atan.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{neg.f64}\left(eh\right), \mathsf{tan.f64}\left(t\right)\right), ew\right)\right)\right)\right)\right)\right) \]
      18. clear-numN/A

        \[\leadsto \mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(ew, \mathsf{cos.f64}\left(t\right)\right), \mathsf{hypot.f64}\left(1, \mathsf{\_.f64}\left(0, \left(eh \cdot \frac{1}{\frac{ew}{\tan t}}\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(eh, \mathsf{sin.f64}\left(t\right)\right), \mathsf{sin.f64}\left(\mathsf{atan.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{neg.f64}\left(eh\right), \mathsf{tan.f64}\left(t\right)\right), ew\right)\right)\right)\right)\right)\right) \]
    4. Applied egg-rr99.9%

      \[\leadsto \left|\color{blue}{\frac{ew \cdot \cos t}{\mathsf{hypot}\left(1, 0 - \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. Taylor expanded in t around 0

      \[\leadsto \mathsf{fabs.f64}\left(\color{blue}{ew}\right) \]
    6. Step-by-step derivation
      1. Simplified57.1%

        \[\leadsto \left|\color{blue}{ew}\right| \]
    7. Recombined 2 regimes into one program.
    8. Add Preprocessing

    Alternative 7: 44.8% accurate, 7.9× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;eh \leq -5.4 \cdot 10^{+82}:\\ \;\;\;\;\left|t \cdot \left(eh + -0.16666666666666666 \cdot \left(eh \cdot \left(t \cdot t\right)\right)\right)\right|\\ \mathbf{elif}\;eh \leq 6.8 \cdot 10^{+214}:\\ \;\;\;\;\left|ew\right|\\ \mathbf{else}:\\ \;\;\;\;\left|t \cdot eh\right|\\ \end{array} \end{array} \]
    (FPCore (eh ew t)
     :precision binary64
     (if (<= eh -5.4e+82)
       (fabs (* t (+ eh (* -0.16666666666666666 (* eh (* t t))))))
       (if (<= eh 6.8e+214) (fabs ew) (fabs (* t eh)))))
    double code(double eh, double ew, double t) {
    	double tmp;
    	if (eh <= -5.4e+82) {
    		tmp = fabs((t * (eh + (-0.16666666666666666 * (eh * (t * t))))));
    	} else if (eh <= 6.8e+214) {
    		tmp = fabs(ew);
    	} else {
    		tmp = fabs((t * eh));
    	}
    	return tmp;
    }
    
    real(8) function code(eh, ew, t)
        real(8), intent (in) :: eh
        real(8), intent (in) :: ew
        real(8), intent (in) :: t
        real(8) :: tmp
        if (eh <= (-5.4d+82)) then
            tmp = abs((t * (eh + ((-0.16666666666666666d0) * (eh * (t * t))))))
        else if (eh <= 6.8d+214) then
            tmp = abs(ew)
        else
            tmp = abs((t * eh))
        end if
        code = tmp
    end function
    
    public static double code(double eh, double ew, double t) {
    	double tmp;
    	if (eh <= -5.4e+82) {
    		tmp = Math.abs((t * (eh + (-0.16666666666666666 * (eh * (t * t))))));
    	} else if (eh <= 6.8e+214) {
    		tmp = Math.abs(ew);
    	} else {
    		tmp = Math.abs((t * eh));
    	}
    	return tmp;
    }
    
    def code(eh, ew, t):
    	tmp = 0
    	if eh <= -5.4e+82:
    		tmp = math.fabs((t * (eh + (-0.16666666666666666 * (eh * (t * t))))))
    	elif eh <= 6.8e+214:
    		tmp = math.fabs(ew)
    	else:
    		tmp = math.fabs((t * eh))
    	return tmp
    
    function code(eh, ew, t)
    	tmp = 0.0
    	if (eh <= -5.4e+82)
    		tmp = abs(Float64(t * Float64(eh + Float64(-0.16666666666666666 * Float64(eh * Float64(t * t))))));
    	elseif (eh <= 6.8e+214)
    		tmp = abs(ew);
    	else
    		tmp = abs(Float64(t * eh));
    	end
    	return tmp
    end
    
    function tmp_2 = code(eh, ew, t)
    	tmp = 0.0;
    	if (eh <= -5.4e+82)
    		tmp = abs((t * (eh + (-0.16666666666666666 * (eh * (t * t))))));
    	elseif (eh <= 6.8e+214)
    		tmp = abs(ew);
    	else
    		tmp = abs((t * eh));
    	end
    	tmp_2 = tmp;
    end
    
    code[eh_, ew_, t_] := If[LessEqual[eh, -5.4e+82], N[Abs[N[(t * N[(eh + N[(-0.16666666666666666 * N[(eh * N[(t * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[eh, 6.8e+214], N[Abs[ew], $MachinePrecision], N[Abs[N[(t * eh), $MachinePrecision]], $MachinePrecision]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    \mathbf{if}\;eh \leq -5.4 \cdot 10^{+82}:\\
    \;\;\;\;\left|t \cdot \left(eh + -0.16666666666666666 \cdot \left(eh \cdot \left(t \cdot t\right)\right)\right)\right|\\
    
    \mathbf{elif}\;eh \leq 6.8 \cdot 10^{+214}:\\
    \;\;\;\;\left|ew\right|\\
    
    \mathbf{else}:\\
    \;\;\;\;\left|t \cdot eh\right|\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 3 regimes
    2. if eh < -5.3999999999999999e82

      1. Initial program 99.7%

        \[\left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right| \]
      2. Add Preprocessing
      3. Applied egg-rr32.5%

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

        \[\leadsto \mathsf{fabs.f64}\left(\mathsf{/.f64}\left(1, \color{blue}{\left(\frac{1}{eh \cdot \sin t}\right)}\right)\right) \]
      5. Step-by-step derivation
        1. /-lowering-/.f64N/A

          \[\leadsto \mathsf{fabs.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(1, \left(eh \cdot \sin t\right)\right)\right)\right) \]
        2. *-lowering-*.f64N/A

          \[\leadsto \mathsf{fabs.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(1, \mathsf{*.f64}\left(eh, \sin t\right)\right)\right)\right) \]
        3. sin-lowering-sin.f6466.3%

          \[\leadsto \mathsf{fabs.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(1, \mathsf{*.f64}\left(eh, \mathsf{sin.f64}\left(t\right)\right)\right)\right)\right) \]
      6. Simplified66.3%

        \[\leadsto \left|\frac{1}{\color{blue}{\frac{1}{eh \cdot \sin t}}}\right| \]
      7. Taylor expanded in t around 0

        \[\leadsto \mathsf{fabs.f64}\left(\color{blue}{\left(t \cdot \left(eh + \frac{-1}{6} \cdot \left(eh \cdot {t}^{2}\right)\right)\right)}\right) \]
      8. Step-by-step derivation
        1. *-lowering-*.f64N/A

          \[\leadsto \mathsf{fabs.f64}\left(\mathsf{*.f64}\left(t, \left(eh + \frac{-1}{6} \cdot \left(eh \cdot {t}^{2}\right)\right)\right)\right) \]
        2. +-lowering-+.f64N/A

          \[\leadsto \mathsf{fabs.f64}\left(\mathsf{*.f64}\left(t, \mathsf{+.f64}\left(eh, \left(\frac{-1}{6} \cdot \left(eh \cdot {t}^{2}\right)\right)\right)\right)\right) \]
        3. *-lowering-*.f64N/A

          \[\leadsto \mathsf{fabs.f64}\left(\mathsf{*.f64}\left(t, \mathsf{+.f64}\left(eh, \mathsf{*.f64}\left(\frac{-1}{6}, \left(eh \cdot {t}^{2}\right)\right)\right)\right)\right) \]
        4. *-lowering-*.f64N/A

          \[\leadsto \mathsf{fabs.f64}\left(\mathsf{*.f64}\left(t, \mathsf{+.f64}\left(eh, \mathsf{*.f64}\left(\frac{-1}{6}, \mathsf{*.f64}\left(eh, \left({t}^{2}\right)\right)\right)\right)\right)\right) \]
        5. unpow2N/A

          \[\leadsto \mathsf{fabs.f64}\left(\mathsf{*.f64}\left(t, \mathsf{+.f64}\left(eh, \mathsf{*.f64}\left(\frac{-1}{6}, \mathsf{*.f64}\left(eh, \left(t \cdot t\right)\right)\right)\right)\right)\right) \]
        6. *-lowering-*.f6438.8%

          \[\leadsto \mathsf{fabs.f64}\left(\mathsf{*.f64}\left(t, \mathsf{+.f64}\left(eh, \mathsf{*.f64}\left(\frac{-1}{6}, \mathsf{*.f64}\left(eh, \mathsf{*.f64}\left(t, t\right)\right)\right)\right)\right)\right) \]
      9. Simplified38.8%

        \[\leadsto \left|\color{blue}{t \cdot \left(eh + -0.16666666666666666 \cdot \left(eh \cdot \left(t \cdot t\right)\right)\right)}\right| \]

      if -5.3999999999999999e82 < eh < 6.7999999999999996e214

      1. Initial program 99.8%

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

          \[\leadsto \mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(\left(\left(ew \cdot \cos t\right) \cdot \frac{1}{\sqrt{1 + \frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t}{ew} \cdot \frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t}{ew}}}\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(eh, \mathsf{sin.f64}\left(t\right)\right), \mathsf{sin.f64}\left(\mathsf{atan.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{neg.f64}\left(eh\right), \mathsf{tan.f64}\left(t\right)\right), ew\right)\right)\right)\right)\right)\right) \]
        2. un-div-invN/A

          \[\leadsto \mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(\left(\frac{ew \cdot \cos t}{\sqrt{1 + \frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t}{ew} \cdot \frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t}{ew}}}\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(eh, \mathsf{sin.f64}\left(t\right)\right), \mathsf{sin.f64}\left(\mathsf{atan.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{neg.f64}\left(eh\right), \mathsf{tan.f64}\left(t\right)\right), ew\right)\right)\right)\right)\right)\right) \]
        3. /-lowering-/.f64N/A

          \[\leadsto \mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(\left(ew \cdot \cos t\right), \left(\sqrt{1 + \frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t}{ew} \cdot \frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t}{ew}}\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(eh, \mathsf{sin.f64}\left(t\right)\right), \mathsf{sin.f64}\left(\mathsf{atan.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{neg.f64}\left(eh\right), \mathsf{tan.f64}\left(t\right)\right), ew\right)\right)\right)\right)\right)\right) \]
        4. *-lowering-*.f64N/A

          \[\leadsto \mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(ew, \cos t\right), \left(\sqrt{1 + \frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t}{ew} \cdot \frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t}{ew}}\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(eh, \mathsf{sin.f64}\left(t\right)\right), \mathsf{sin.f64}\left(\mathsf{atan.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{neg.f64}\left(eh\right), \mathsf{tan.f64}\left(t\right)\right), ew\right)\right)\right)\right)\right)\right) \]
        5. cos-lowering-cos.f64N/A

          \[\leadsto \mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(ew, \mathsf{cos.f64}\left(t\right)\right), \left(\sqrt{1 + \frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t}{ew} \cdot \frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t}{ew}}\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(eh, \mathsf{sin.f64}\left(t\right)\right), \mathsf{sin.f64}\left(\mathsf{atan.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{neg.f64}\left(eh\right), \mathsf{tan.f64}\left(t\right)\right), ew\right)\right)\right)\right)\right)\right) \]
        6. hypot-1-defN/A

          \[\leadsto \mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(ew, \mathsf{cos.f64}\left(t\right)\right), \left(\mathsf{hypot}\left(1, \frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t}{ew}\right)\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(eh, \mathsf{sin.f64}\left(t\right)\right), \mathsf{sin.f64}\left(\mathsf{atan.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{neg.f64}\left(eh\right), \mathsf{tan.f64}\left(t\right)\right), ew\right)\right)\right)\right)\right)\right) \]
        7. hypot-lowering-hypot.f64N/A

          \[\leadsto \mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(ew, \mathsf{cos.f64}\left(t\right)\right), \mathsf{hypot.f64}\left(1, \left(\frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t}{ew}\right)\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(eh, \mathsf{sin.f64}\left(t\right)\right), \mathsf{sin.f64}\left(\mathsf{atan.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{neg.f64}\left(eh\right), \mathsf{tan.f64}\left(t\right)\right), ew\right)\right)\right)\right)\right)\right) \]
        8. associate-/l*N/A

          \[\leadsto \mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(ew, \mathsf{cos.f64}\left(t\right)\right), \mathsf{hypot.f64}\left(1, \left(\left(\mathsf{neg}\left(eh\right)\right) \cdot \frac{\tan t}{ew}\right)\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(eh, \mathsf{sin.f64}\left(t\right)\right), \mathsf{sin.f64}\left(\mathsf{atan.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{neg.f64}\left(eh\right), \mathsf{tan.f64}\left(t\right)\right), ew\right)\right)\right)\right)\right)\right) \]
        9. distribute-lft-neg-outN/A

          \[\leadsto \mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(ew, \mathsf{cos.f64}\left(t\right)\right), \mathsf{hypot.f64}\left(1, \left(\mathsf{neg}\left(eh \cdot \frac{\tan t}{ew}\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(eh, \mathsf{sin.f64}\left(t\right)\right), \mathsf{sin.f64}\left(\mathsf{atan.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{neg.f64}\left(eh\right), \mathsf{tan.f64}\left(t\right)\right), ew\right)\right)\right)\right)\right)\right) \]
        10. neg-sub0N/A

          \[\leadsto \mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(ew, \mathsf{cos.f64}\left(t\right)\right), \mathsf{hypot.f64}\left(1, \left(0 - eh \cdot \frac{\tan t}{ew}\right)\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(eh, \mathsf{sin.f64}\left(t\right)\right), \mathsf{sin.f64}\left(\mathsf{atan.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{neg.f64}\left(eh\right), \mathsf{tan.f64}\left(t\right)\right), ew\right)\right)\right)\right)\right)\right) \]
        11. remove-double-negN/A

          \[\leadsto \mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(ew, \mathsf{cos.f64}\left(t\right)\right), \mathsf{hypot.f64}\left(1, \left(0 - \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(eh \cdot \frac{\tan t}{ew}\right)\right)\right)\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(eh, \mathsf{sin.f64}\left(t\right)\right), \mathsf{sin.f64}\left(\mathsf{atan.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{neg.f64}\left(eh\right), \mathsf{tan.f64}\left(t\right)\right), ew\right)\right)\right)\right)\right)\right) \]
        12. distribute-lft-neg-outN/A

          \[\leadsto \mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(ew, \mathsf{cos.f64}\left(t\right)\right), \mathsf{hypot.f64}\left(1, \left(0 - \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(eh\right)\right) \cdot \frac{\tan t}{ew}\right)\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(eh, \mathsf{sin.f64}\left(t\right)\right), \mathsf{sin.f64}\left(\mathsf{atan.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{neg.f64}\left(eh\right), \mathsf{tan.f64}\left(t\right)\right), ew\right)\right)\right)\right)\right)\right) \]
        13. associate-/l*N/A

          \[\leadsto \mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(ew, \mathsf{cos.f64}\left(t\right)\right), \mathsf{hypot.f64}\left(1, \left(0 - \left(\mathsf{neg}\left(\frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t}{ew}\right)\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(eh, \mathsf{sin.f64}\left(t\right)\right), \mathsf{sin.f64}\left(\mathsf{atan.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{neg.f64}\left(eh\right), \mathsf{tan.f64}\left(t\right)\right), ew\right)\right)\right)\right)\right)\right) \]
        14. --lowering--.f64N/A

          \[\leadsto \mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(ew, \mathsf{cos.f64}\left(t\right)\right), \mathsf{hypot.f64}\left(1, \mathsf{\_.f64}\left(0, \left(\mathsf{neg}\left(\frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t}{ew}\right)\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(eh, \mathsf{sin.f64}\left(t\right)\right), \mathsf{sin.f64}\left(\mathsf{atan.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{neg.f64}\left(eh\right), \mathsf{tan.f64}\left(t\right)\right), ew\right)\right)\right)\right)\right)\right) \]
        15. associate-/l*N/A

          \[\leadsto \mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(ew, \mathsf{cos.f64}\left(t\right)\right), \mathsf{hypot.f64}\left(1, \mathsf{\_.f64}\left(0, \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(eh\right)\right) \cdot \frac{\tan t}{ew}\right)\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(eh, \mathsf{sin.f64}\left(t\right)\right), \mathsf{sin.f64}\left(\mathsf{atan.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{neg.f64}\left(eh\right), \mathsf{tan.f64}\left(t\right)\right), ew\right)\right)\right)\right)\right)\right) \]
        16. distribute-lft-neg-outN/A

          \[\leadsto \mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(ew, \mathsf{cos.f64}\left(t\right)\right), \mathsf{hypot.f64}\left(1, \mathsf{\_.f64}\left(0, \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(eh \cdot \frac{\tan t}{ew}\right)\right)\right)\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(eh, \mathsf{sin.f64}\left(t\right)\right), \mathsf{sin.f64}\left(\mathsf{atan.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{neg.f64}\left(eh\right), \mathsf{tan.f64}\left(t\right)\right), ew\right)\right)\right)\right)\right)\right) \]
        17. remove-double-negN/A

          \[\leadsto \mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(ew, \mathsf{cos.f64}\left(t\right)\right), \mathsf{hypot.f64}\left(1, \mathsf{\_.f64}\left(0, \left(eh \cdot \frac{\tan t}{ew}\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(eh, \mathsf{sin.f64}\left(t\right)\right), \mathsf{sin.f64}\left(\mathsf{atan.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{neg.f64}\left(eh\right), \mathsf{tan.f64}\left(t\right)\right), ew\right)\right)\right)\right)\right)\right) \]
        18. clear-numN/A

          \[\leadsto \mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(ew, \mathsf{cos.f64}\left(t\right)\right), \mathsf{hypot.f64}\left(1, \mathsf{\_.f64}\left(0, \left(eh \cdot \frac{1}{\frac{ew}{\tan t}}\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(eh, \mathsf{sin.f64}\left(t\right)\right), \mathsf{sin.f64}\left(\mathsf{atan.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{neg.f64}\left(eh\right), \mathsf{tan.f64}\left(t\right)\right), ew\right)\right)\right)\right)\right)\right) \]
      4. Applied egg-rr99.8%

        \[\leadsto \left|\color{blue}{\frac{ew \cdot \cos t}{\mathsf{hypot}\left(1, 0 - \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. Taylor expanded in t around 0

        \[\leadsto \mathsf{fabs.f64}\left(\color{blue}{ew}\right) \]
      6. Step-by-step derivation
        1. Simplified50.2%

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

        if 6.7999999999999996e214 < eh

        1. Initial program 99.8%

          \[\left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right| \]
        2. Add Preprocessing
        3. Applied egg-rr16.1%

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

          \[\leadsto \mathsf{fabs.f64}\left(\mathsf{/.f64}\left(1, \color{blue}{\left(\frac{1}{eh \cdot \sin t}\right)}\right)\right) \]
        5. Step-by-step derivation
          1. /-lowering-/.f64N/A

            \[\leadsto \mathsf{fabs.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(1, \left(eh \cdot \sin t\right)\right)\right)\right) \]
          2. *-lowering-*.f64N/A

            \[\leadsto \mathsf{fabs.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(1, \mathsf{*.f64}\left(eh, \sin t\right)\right)\right)\right) \]
          3. sin-lowering-sin.f6490.5%

            \[\leadsto \mathsf{fabs.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(1, \mathsf{*.f64}\left(eh, \mathsf{sin.f64}\left(t\right)\right)\right)\right)\right) \]
        6. Simplified90.5%

          \[\leadsto \left|\frac{1}{\color{blue}{\frac{1}{eh \cdot \sin t}}}\right| \]
        7. Taylor expanded in t around 0

          \[\leadsto \mathsf{fabs.f64}\left(\color{blue}{\left(eh \cdot t\right)}\right) \]
        8. Step-by-step derivation
          1. *-lowering-*.f6451.5%

            \[\leadsto \mathsf{fabs.f64}\left(\mathsf{*.f64}\left(eh, t\right)\right) \]
        9. Simplified51.5%

          \[\leadsto \left|\color{blue}{eh \cdot t}\right| \]
      7. Recombined 3 regimes into one program.
      8. Final simplification48.3%

        \[\leadsto \begin{array}{l} \mathbf{if}\;eh \leq -5.4 \cdot 10^{+82}:\\ \;\;\;\;\left|t \cdot \left(eh + -0.16666666666666666 \cdot \left(eh \cdot \left(t \cdot t\right)\right)\right)\right|\\ \mathbf{elif}\;eh \leq 6.8 \cdot 10^{+214}:\\ \;\;\;\;\left|ew\right|\\ \mathbf{else}:\\ \;\;\;\;\left|t \cdot eh\right|\\ \end{array} \]
      9. Add Preprocessing

      Alternative 8: 44.8% accurate, 8.1× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} t_1 := \left|t \cdot eh\right|\\ \mathbf{if}\;eh \leq -1.2 \cdot 10^{+82}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;eh \leq 2.8 \cdot 10^{+215}:\\ \;\;\;\;\left|ew\right|\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
      (FPCore (eh ew t)
       :precision binary64
       (let* ((t_1 (fabs (* t eh))))
         (if (<= eh -1.2e+82) t_1 (if (<= eh 2.8e+215) (fabs ew) t_1))))
      double code(double eh, double ew, double t) {
      	double t_1 = fabs((t * eh));
      	double tmp;
      	if (eh <= -1.2e+82) {
      		tmp = t_1;
      	} else if (eh <= 2.8e+215) {
      		tmp = fabs(ew);
      	} else {
      		tmp = t_1;
      	}
      	return tmp;
      }
      
      real(8) function code(eh, ew, t)
          real(8), intent (in) :: eh
          real(8), intent (in) :: ew
          real(8), intent (in) :: t
          real(8) :: t_1
          real(8) :: tmp
          t_1 = abs((t * eh))
          if (eh <= (-1.2d+82)) then
              tmp = t_1
          else if (eh <= 2.8d+215) then
              tmp = abs(ew)
          else
              tmp = t_1
          end if
          code = tmp
      end function
      
      public static double code(double eh, double ew, double t) {
      	double t_1 = Math.abs((t * eh));
      	double tmp;
      	if (eh <= -1.2e+82) {
      		tmp = t_1;
      	} else if (eh <= 2.8e+215) {
      		tmp = Math.abs(ew);
      	} else {
      		tmp = t_1;
      	}
      	return tmp;
      }
      
      def code(eh, ew, t):
      	t_1 = math.fabs((t * eh))
      	tmp = 0
      	if eh <= -1.2e+82:
      		tmp = t_1
      	elif eh <= 2.8e+215:
      		tmp = math.fabs(ew)
      	else:
      		tmp = t_1
      	return tmp
      
      function code(eh, ew, t)
      	t_1 = abs(Float64(t * eh))
      	tmp = 0.0
      	if (eh <= -1.2e+82)
      		tmp = t_1;
      	elseif (eh <= 2.8e+215)
      		tmp = abs(ew);
      	else
      		tmp = t_1;
      	end
      	return tmp
      end
      
      function tmp_2 = code(eh, ew, t)
      	t_1 = abs((t * eh));
      	tmp = 0.0;
      	if (eh <= -1.2e+82)
      		tmp = t_1;
      	elseif (eh <= 2.8e+215)
      		tmp = abs(ew);
      	else
      		tmp = t_1;
      	end
      	tmp_2 = tmp;
      end
      
      code[eh_, ew_, t_] := Block[{t$95$1 = N[Abs[N[(t * eh), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[eh, -1.2e+82], t$95$1, If[LessEqual[eh, 2.8e+215], N[Abs[ew], $MachinePrecision], t$95$1]]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      t_1 := \left|t \cdot eh\right|\\
      \mathbf{if}\;eh \leq -1.2 \cdot 10^{+82}:\\
      \;\;\;\;t\_1\\
      
      \mathbf{elif}\;eh \leq 2.8 \cdot 10^{+215}:\\
      \;\;\;\;\left|ew\right|\\
      
      \mathbf{else}:\\
      \;\;\;\;t\_1\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if eh < -1.19999999999999999e82 or 2.8e215 < eh

        1. Initial program 99.7%

          \[\left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right| \]
        2. Add Preprocessing
        3. Applied egg-rr27.3%

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

          \[\leadsto \mathsf{fabs.f64}\left(\mathsf{/.f64}\left(1, \color{blue}{\left(\frac{1}{eh \cdot \sin t}\right)}\right)\right) \]
        5. Step-by-step derivation
          1. /-lowering-/.f64N/A

            \[\leadsto \mathsf{fabs.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(1, \left(eh \cdot \sin t\right)\right)\right)\right) \]
          2. *-lowering-*.f64N/A

            \[\leadsto \mathsf{fabs.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(1, \mathsf{*.f64}\left(eh, \sin t\right)\right)\right)\right) \]
          3. sin-lowering-sin.f6473.9%

            \[\leadsto \mathsf{fabs.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(1, \mathsf{*.f64}\left(eh, \mathsf{sin.f64}\left(t\right)\right)\right)\right)\right) \]
        6. Simplified73.9%

          \[\leadsto \left|\frac{1}{\color{blue}{\frac{1}{eh \cdot \sin t}}}\right| \]
        7. Taylor expanded in t around 0

          \[\leadsto \mathsf{fabs.f64}\left(\color{blue}{\left(eh \cdot t\right)}\right) \]
        8. Step-by-step derivation
          1. *-lowering-*.f6442.5%

            \[\leadsto \mathsf{fabs.f64}\left(\mathsf{*.f64}\left(eh, t\right)\right) \]
        9. Simplified42.5%

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

        if -1.19999999999999999e82 < eh < 2.8e215

        1. Initial program 99.8%

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

            \[\leadsto \mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(\left(\left(ew \cdot \cos t\right) \cdot \frac{1}{\sqrt{1 + \frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t}{ew} \cdot \frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t}{ew}}}\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(eh, \mathsf{sin.f64}\left(t\right)\right), \mathsf{sin.f64}\left(\mathsf{atan.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{neg.f64}\left(eh\right), \mathsf{tan.f64}\left(t\right)\right), ew\right)\right)\right)\right)\right)\right) \]
          2. un-div-invN/A

            \[\leadsto \mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(\left(\frac{ew \cdot \cos t}{\sqrt{1 + \frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t}{ew} \cdot \frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t}{ew}}}\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(eh, \mathsf{sin.f64}\left(t\right)\right), \mathsf{sin.f64}\left(\mathsf{atan.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{neg.f64}\left(eh\right), \mathsf{tan.f64}\left(t\right)\right), ew\right)\right)\right)\right)\right)\right) \]
          3. /-lowering-/.f64N/A

            \[\leadsto \mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(\left(ew \cdot \cos t\right), \left(\sqrt{1 + \frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t}{ew} \cdot \frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t}{ew}}\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(eh, \mathsf{sin.f64}\left(t\right)\right), \mathsf{sin.f64}\left(\mathsf{atan.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{neg.f64}\left(eh\right), \mathsf{tan.f64}\left(t\right)\right), ew\right)\right)\right)\right)\right)\right) \]
          4. *-lowering-*.f64N/A

            \[\leadsto \mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(ew, \cos t\right), \left(\sqrt{1 + \frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t}{ew} \cdot \frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t}{ew}}\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(eh, \mathsf{sin.f64}\left(t\right)\right), \mathsf{sin.f64}\left(\mathsf{atan.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{neg.f64}\left(eh\right), \mathsf{tan.f64}\left(t\right)\right), ew\right)\right)\right)\right)\right)\right) \]
          5. cos-lowering-cos.f64N/A

            \[\leadsto \mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(ew, \mathsf{cos.f64}\left(t\right)\right), \left(\sqrt{1 + \frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t}{ew} \cdot \frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t}{ew}}\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(eh, \mathsf{sin.f64}\left(t\right)\right), \mathsf{sin.f64}\left(\mathsf{atan.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{neg.f64}\left(eh\right), \mathsf{tan.f64}\left(t\right)\right), ew\right)\right)\right)\right)\right)\right) \]
          6. hypot-1-defN/A

            \[\leadsto \mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(ew, \mathsf{cos.f64}\left(t\right)\right), \left(\mathsf{hypot}\left(1, \frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t}{ew}\right)\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(eh, \mathsf{sin.f64}\left(t\right)\right), \mathsf{sin.f64}\left(\mathsf{atan.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{neg.f64}\left(eh\right), \mathsf{tan.f64}\left(t\right)\right), ew\right)\right)\right)\right)\right)\right) \]
          7. hypot-lowering-hypot.f64N/A

            \[\leadsto \mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(ew, \mathsf{cos.f64}\left(t\right)\right), \mathsf{hypot.f64}\left(1, \left(\frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t}{ew}\right)\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(eh, \mathsf{sin.f64}\left(t\right)\right), \mathsf{sin.f64}\left(\mathsf{atan.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{neg.f64}\left(eh\right), \mathsf{tan.f64}\left(t\right)\right), ew\right)\right)\right)\right)\right)\right) \]
          8. associate-/l*N/A

            \[\leadsto \mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(ew, \mathsf{cos.f64}\left(t\right)\right), \mathsf{hypot.f64}\left(1, \left(\left(\mathsf{neg}\left(eh\right)\right) \cdot \frac{\tan t}{ew}\right)\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(eh, \mathsf{sin.f64}\left(t\right)\right), \mathsf{sin.f64}\left(\mathsf{atan.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{neg.f64}\left(eh\right), \mathsf{tan.f64}\left(t\right)\right), ew\right)\right)\right)\right)\right)\right) \]
          9. distribute-lft-neg-outN/A

            \[\leadsto \mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(ew, \mathsf{cos.f64}\left(t\right)\right), \mathsf{hypot.f64}\left(1, \left(\mathsf{neg}\left(eh \cdot \frac{\tan t}{ew}\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(eh, \mathsf{sin.f64}\left(t\right)\right), \mathsf{sin.f64}\left(\mathsf{atan.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{neg.f64}\left(eh\right), \mathsf{tan.f64}\left(t\right)\right), ew\right)\right)\right)\right)\right)\right) \]
          10. neg-sub0N/A

            \[\leadsto \mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(ew, \mathsf{cos.f64}\left(t\right)\right), \mathsf{hypot.f64}\left(1, \left(0 - eh \cdot \frac{\tan t}{ew}\right)\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(eh, \mathsf{sin.f64}\left(t\right)\right), \mathsf{sin.f64}\left(\mathsf{atan.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{neg.f64}\left(eh\right), \mathsf{tan.f64}\left(t\right)\right), ew\right)\right)\right)\right)\right)\right) \]
          11. remove-double-negN/A

            \[\leadsto \mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(ew, \mathsf{cos.f64}\left(t\right)\right), \mathsf{hypot.f64}\left(1, \left(0 - \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(eh \cdot \frac{\tan t}{ew}\right)\right)\right)\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(eh, \mathsf{sin.f64}\left(t\right)\right), \mathsf{sin.f64}\left(\mathsf{atan.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{neg.f64}\left(eh\right), \mathsf{tan.f64}\left(t\right)\right), ew\right)\right)\right)\right)\right)\right) \]
          12. distribute-lft-neg-outN/A

            \[\leadsto \mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(ew, \mathsf{cos.f64}\left(t\right)\right), \mathsf{hypot.f64}\left(1, \left(0 - \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(eh\right)\right) \cdot \frac{\tan t}{ew}\right)\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(eh, \mathsf{sin.f64}\left(t\right)\right), \mathsf{sin.f64}\left(\mathsf{atan.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{neg.f64}\left(eh\right), \mathsf{tan.f64}\left(t\right)\right), ew\right)\right)\right)\right)\right)\right) \]
          13. associate-/l*N/A

            \[\leadsto \mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(ew, \mathsf{cos.f64}\left(t\right)\right), \mathsf{hypot.f64}\left(1, \left(0 - \left(\mathsf{neg}\left(\frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t}{ew}\right)\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(eh, \mathsf{sin.f64}\left(t\right)\right), \mathsf{sin.f64}\left(\mathsf{atan.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{neg.f64}\left(eh\right), \mathsf{tan.f64}\left(t\right)\right), ew\right)\right)\right)\right)\right)\right) \]
          14. --lowering--.f64N/A

            \[\leadsto \mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(ew, \mathsf{cos.f64}\left(t\right)\right), \mathsf{hypot.f64}\left(1, \mathsf{\_.f64}\left(0, \left(\mathsf{neg}\left(\frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t}{ew}\right)\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(eh, \mathsf{sin.f64}\left(t\right)\right), \mathsf{sin.f64}\left(\mathsf{atan.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{neg.f64}\left(eh\right), \mathsf{tan.f64}\left(t\right)\right), ew\right)\right)\right)\right)\right)\right) \]
          15. associate-/l*N/A

            \[\leadsto \mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(ew, \mathsf{cos.f64}\left(t\right)\right), \mathsf{hypot.f64}\left(1, \mathsf{\_.f64}\left(0, \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(eh\right)\right) \cdot \frac{\tan t}{ew}\right)\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(eh, \mathsf{sin.f64}\left(t\right)\right), \mathsf{sin.f64}\left(\mathsf{atan.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{neg.f64}\left(eh\right), \mathsf{tan.f64}\left(t\right)\right), ew\right)\right)\right)\right)\right)\right) \]
          16. distribute-lft-neg-outN/A

            \[\leadsto \mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(ew, \mathsf{cos.f64}\left(t\right)\right), \mathsf{hypot.f64}\left(1, \mathsf{\_.f64}\left(0, \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(eh \cdot \frac{\tan t}{ew}\right)\right)\right)\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(eh, \mathsf{sin.f64}\left(t\right)\right), \mathsf{sin.f64}\left(\mathsf{atan.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{neg.f64}\left(eh\right), \mathsf{tan.f64}\left(t\right)\right), ew\right)\right)\right)\right)\right)\right) \]
          17. remove-double-negN/A

            \[\leadsto \mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(ew, \mathsf{cos.f64}\left(t\right)\right), \mathsf{hypot.f64}\left(1, \mathsf{\_.f64}\left(0, \left(eh \cdot \frac{\tan t}{ew}\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(eh, \mathsf{sin.f64}\left(t\right)\right), \mathsf{sin.f64}\left(\mathsf{atan.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{neg.f64}\left(eh\right), \mathsf{tan.f64}\left(t\right)\right), ew\right)\right)\right)\right)\right)\right) \]
          18. clear-numN/A

            \[\leadsto \mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(ew, \mathsf{cos.f64}\left(t\right)\right), \mathsf{hypot.f64}\left(1, \mathsf{\_.f64}\left(0, \left(eh \cdot \frac{1}{\frac{ew}{\tan t}}\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(eh, \mathsf{sin.f64}\left(t\right)\right), \mathsf{sin.f64}\left(\mathsf{atan.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{neg.f64}\left(eh\right), \mathsf{tan.f64}\left(t\right)\right), ew\right)\right)\right)\right)\right)\right) \]
        4. Applied egg-rr99.8%

          \[\leadsto \left|\color{blue}{\frac{ew \cdot \cos t}{\mathsf{hypot}\left(1, 0 - \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. Taylor expanded in t around 0

          \[\leadsto \mathsf{fabs.f64}\left(\color{blue}{ew}\right) \]
        6. Step-by-step derivation
          1. Simplified50.2%

            \[\leadsto \left|\color{blue}{ew}\right| \]
        7. Recombined 2 regimes into one program.
        8. Final simplification48.2%

          \[\leadsto \begin{array}{l} \mathbf{if}\;eh \leq -1.2 \cdot 10^{+82}:\\ \;\;\;\;\left|t \cdot eh\right|\\ \mathbf{elif}\;eh \leq 2.8 \cdot 10^{+215}:\\ \;\;\;\;\left|ew\right|\\ \mathbf{else}:\\ \;\;\;\;\left|t \cdot eh\right|\\ \end{array} \]
        9. Add Preprocessing

        Alternative 9: 42.9% accurate, 9.1× speedup?

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

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

            \[\leadsto \mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(\left(\left(ew \cdot \cos t\right) \cdot \frac{1}{\sqrt{1 + \frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t}{ew} \cdot \frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t}{ew}}}\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(eh, \mathsf{sin.f64}\left(t\right)\right), \mathsf{sin.f64}\left(\mathsf{atan.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{neg.f64}\left(eh\right), \mathsf{tan.f64}\left(t\right)\right), ew\right)\right)\right)\right)\right)\right) \]
          2. un-div-invN/A

            \[\leadsto \mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(\left(\frac{ew \cdot \cos t}{\sqrt{1 + \frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t}{ew} \cdot \frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t}{ew}}}\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(eh, \mathsf{sin.f64}\left(t\right)\right), \mathsf{sin.f64}\left(\mathsf{atan.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{neg.f64}\left(eh\right), \mathsf{tan.f64}\left(t\right)\right), ew\right)\right)\right)\right)\right)\right) \]
          3. /-lowering-/.f64N/A

            \[\leadsto \mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(\left(ew \cdot \cos t\right), \left(\sqrt{1 + \frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t}{ew} \cdot \frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t}{ew}}\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(eh, \mathsf{sin.f64}\left(t\right)\right), \mathsf{sin.f64}\left(\mathsf{atan.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{neg.f64}\left(eh\right), \mathsf{tan.f64}\left(t\right)\right), ew\right)\right)\right)\right)\right)\right) \]
          4. *-lowering-*.f64N/A

            \[\leadsto \mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(ew, \cos t\right), \left(\sqrt{1 + \frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t}{ew} \cdot \frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t}{ew}}\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(eh, \mathsf{sin.f64}\left(t\right)\right), \mathsf{sin.f64}\left(\mathsf{atan.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{neg.f64}\left(eh\right), \mathsf{tan.f64}\left(t\right)\right), ew\right)\right)\right)\right)\right)\right) \]
          5. cos-lowering-cos.f64N/A

            \[\leadsto \mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(ew, \mathsf{cos.f64}\left(t\right)\right), \left(\sqrt{1 + \frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t}{ew} \cdot \frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t}{ew}}\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(eh, \mathsf{sin.f64}\left(t\right)\right), \mathsf{sin.f64}\left(\mathsf{atan.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{neg.f64}\left(eh\right), \mathsf{tan.f64}\left(t\right)\right), ew\right)\right)\right)\right)\right)\right) \]
          6. hypot-1-defN/A

            \[\leadsto \mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(ew, \mathsf{cos.f64}\left(t\right)\right), \left(\mathsf{hypot}\left(1, \frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t}{ew}\right)\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(eh, \mathsf{sin.f64}\left(t\right)\right), \mathsf{sin.f64}\left(\mathsf{atan.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{neg.f64}\left(eh\right), \mathsf{tan.f64}\left(t\right)\right), ew\right)\right)\right)\right)\right)\right) \]
          7. hypot-lowering-hypot.f64N/A

            \[\leadsto \mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(ew, \mathsf{cos.f64}\left(t\right)\right), \mathsf{hypot.f64}\left(1, \left(\frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t}{ew}\right)\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(eh, \mathsf{sin.f64}\left(t\right)\right), \mathsf{sin.f64}\left(\mathsf{atan.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{neg.f64}\left(eh\right), \mathsf{tan.f64}\left(t\right)\right), ew\right)\right)\right)\right)\right)\right) \]
          8. associate-/l*N/A

            \[\leadsto \mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(ew, \mathsf{cos.f64}\left(t\right)\right), \mathsf{hypot.f64}\left(1, \left(\left(\mathsf{neg}\left(eh\right)\right) \cdot \frac{\tan t}{ew}\right)\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(eh, \mathsf{sin.f64}\left(t\right)\right), \mathsf{sin.f64}\left(\mathsf{atan.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{neg.f64}\left(eh\right), \mathsf{tan.f64}\left(t\right)\right), ew\right)\right)\right)\right)\right)\right) \]
          9. distribute-lft-neg-outN/A

            \[\leadsto \mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(ew, \mathsf{cos.f64}\left(t\right)\right), \mathsf{hypot.f64}\left(1, \left(\mathsf{neg}\left(eh \cdot \frac{\tan t}{ew}\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(eh, \mathsf{sin.f64}\left(t\right)\right), \mathsf{sin.f64}\left(\mathsf{atan.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{neg.f64}\left(eh\right), \mathsf{tan.f64}\left(t\right)\right), ew\right)\right)\right)\right)\right)\right) \]
          10. neg-sub0N/A

            \[\leadsto \mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(ew, \mathsf{cos.f64}\left(t\right)\right), \mathsf{hypot.f64}\left(1, \left(0 - eh \cdot \frac{\tan t}{ew}\right)\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(eh, \mathsf{sin.f64}\left(t\right)\right), \mathsf{sin.f64}\left(\mathsf{atan.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{neg.f64}\left(eh\right), \mathsf{tan.f64}\left(t\right)\right), ew\right)\right)\right)\right)\right)\right) \]
          11. remove-double-negN/A

            \[\leadsto \mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(ew, \mathsf{cos.f64}\left(t\right)\right), \mathsf{hypot.f64}\left(1, \left(0 - \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(eh \cdot \frac{\tan t}{ew}\right)\right)\right)\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(eh, \mathsf{sin.f64}\left(t\right)\right), \mathsf{sin.f64}\left(\mathsf{atan.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{neg.f64}\left(eh\right), \mathsf{tan.f64}\left(t\right)\right), ew\right)\right)\right)\right)\right)\right) \]
          12. distribute-lft-neg-outN/A

            \[\leadsto \mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(ew, \mathsf{cos.f64}\left(t\right)\right), \mathsf{hypot.f64}\left(1, \left(0 - \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(eh\right)\right) \cdot \frac{\tan t}{ew}\right)\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(eh, \mathsf{sin.f64}\left(t\right)\right), \mathsf{sin.f64}\left(\mathsf{atan.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{neg.f64}\left(eh\right), \mathsf{tan.f64}\left(t\right)\right), ew\right)\right)\right)\right)\right)\right) \]
          13. associate-/l*N/A

            \[\leadsto \mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(ew, \mathsf{cos.f64}\left(t\right)\right), \mathsf{hypot.f64}\left(1, \left(0 - \left(\mathsf{neg}\left(\frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t}{ew}\right)\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(eh, \mathsf{sin.f64}\left(t\right)\right), \mathsf{sin.f64}\left(\mathsf{atan.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{neg.f64}\left(eh\right), \mathsf{tan.f64}\left(t\right)\right), ew\right)\right)\right)\right)\right)\right) \]
          14. --lowering--.f64N/A

            \[\leadsto \mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(ew, \mathsf{cos.f64}\left(t\right)\right), \mathsf{hypot.f64}\left(1, \mathsf{\_.f64}\left(0, \left(\mathsf{neg}\left(\frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t}{ew}\right)\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(eh, \mathsf{sin.f64}\left(t\right)\right), \mathsf{sin.f64}\left(\mathsf{atan.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{neg.f64}\left(eh\right), \mathsf{tan.f64}\left(t\right)\right), ew\right)\right)\right)\right)\right)\right) \]
          15. associate-/l*N/A

            \[\leadsto \mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(ew, \mathsf{cos.f64}\left(t\right)\right), \mathsf{hypot.f64}\left(1, \mathsf{\_.f64}\left(0, \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(eh\right)\right) \cdot \frac{\tan t}{ew}\right)\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(eh, \mathsf{sin.f64}\left(t\right)\right), \mathsf{sin.f64}\left(\mathsf{atan.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{neg.f64}\left(eh\right), \mathsf{tan.f64}\left(t\right)\right), ew\right)\right)\right)\right)\right)\right) \]
          16. distribute-lft-neg-outN/A

            \[\leadsto \mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(ew, \mathsf{cos.f64}\left(t\right)\right), \mathsf{hypot.f64}\left(1, \mathsf{\_.f64}\left(0, \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(eh \cdot \frac{\tan t}{ew}\right)\right)\right)\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(eh, \mathsf{sin.f64}\left(t\right)\right), \mathsf{sin.f64}\left(\mathsf{atan.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{neg.f64}\left(eh\right), \mathsf{tan.f64}\left(t\right)\right), ew\right)\right)\right)\right)\right)\right) \]
          17. remove-double-negN/A

            \[\leadsto \mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(ew, \mathsf{cos.f64}\left(t\right)\right), \mathsf{hypot.f64}\left(1, \mathsf{\_.f64}\left(0, \left(eh \cdot \frac{\tan t}{ew}\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(eh, \mathsf{sin.f64}\left(t\right)\right), \mathsf{sin.f64}\left(\mathsf{atan.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{neg.f64}\left(eh\right), \mathsf{tan.f64}\left(t\right)\right), ew\right)\right)\right)\right)\right)\right) \]
          18. clear-numN/A

            \[\leadsto \mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(ew, \mathsf{cos.f64}\left(t\right)\right), \mathsf{hypot.f64}\left(1, \mathsf{\_.f64}\left(0, \left(eh \cdot \frac{1}{\frac{ew}{\tan t}}\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(eh, \mathsf{sin.f64}\left(t\right)\right), \mathsf{sin.f64}\left(\mathsf{atan.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{neg.f64}\left(eh\right), \mathsf{tan.f64}\left(t\right)\right), ew\right)\right)\right)\right)\right)\right) \]
        4. Applied egg-rr99.8%

          \[\leadsto \left|\color{blue}{\frac{ew \cdot \cos t}{\mathsf{hypot}\left(1, 0 - \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. Taylor expanded in t around 0

          \[\leadsto \mathsf{fabs.f64}\left(\color{blue}{ew}\right) \]
        6. Step-by-step derivation
          1. Simplified42.9%

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

          Reproduce

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