Example 2 from Robby

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

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

Initial Program: 99.8% accurate, 1.0× speedup?

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

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

Alternative 1: 99.8% accurate, 1.0× speedup?

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

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

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

      \[\leadsto \mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(ew, \mathsf{cos.f64}\left(t\right)\right), \cos \tan^{-1} \left(\frac{\mathsf{neg}\left(\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t\right)}{\mathsf{neg}\left(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) \]
    2. distribute-frac-neg2N/A

      \[\leadsto \mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(ew, \mathsf{cos.f64}\left(t\right)\right), \cos \tan^{-1} \left(\mathsf{neg}\left(\frac{\mathsf{neg}\left(\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t\right)}{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) \]
    3. atan-negN/A

      \[\leadsto \mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(ew, \mathsf{cos.f64}\left(t\right)\right), \cos \left(\mathsf{neg}\left(\tan^{-1} \left(\frac{\mathsf{neg}\left(\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t\right)}{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) \]
    4. cos-negN/A

      \[\leadsto \mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(ew, \mathsf{cos.f64}\left(t\right)\right), \cos \tan^{-1} \left(\frac{\mathsf{neg}\left(\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t\right)}{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), \mathsf{cos.f64}\left(\tan^{-1} \left(\frac{\mathsf{neg}\left(\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t\right)}{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) \]
    6. atan-lowering-atan.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{cos.f64}\left(\mathsf{atan.f64}\left(\left(\frac{\mathsf{neg}\left(\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t\right)}{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) \]
    7. /-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{cos.f64}\left(\mathsf{atan.f64}\left(\mathsf{/.f64}\left(\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t\right)\right), 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) \]
    8. 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{cos.f64}\left(\mathsf{atan.f64}\left(\mathsf{/.f64}\left(\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(eh \cdot \tan t\right)\right)\right)\right), 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) \]
    9. 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{cos.f64}\left(\mathsf{atan.f64}\left(\mathsf{/.f64}\left(\left(eh \cdot \tan t\right), 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. *-commutativeN/A

      \[\leadsto \mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(ew, \mathsf{cos.f64}\left(t\right)\right), \mathsf{cos.f64}\left(\mathsf{atan.f64}\left(\mathsf{/.f64}\left(\left(\tan t \cdot eh\right), 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) \]
    11. +-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{cos.f64}\left(\mathsf{atan.f64}\left(\mathsf{/.f64}\left(\left(\tan t \cdot \left(0 + eh\right)\right), 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) \]
    12. *-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{cos.f64}\left(\mathsf{atan.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\tan t, \left(0 + eh\right)\right), 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) \]
    13. tan-lowering-tan.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{cos.f64}\left(\mathsf{atan.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{tan.f64}\left(t\right), \left(0 + eh\right)\right), 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) \]
    14. +-lft-identity99.8%

      \[\leadsto \mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(ew, \mathsf{cos.f64}\left(t\right)\right), \mathsf{cos.f64}\left(\mathsf{atan.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{tan.f64}\left(t\right), eh\right), 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) \]
  4. Applied egg-rr99.8%

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

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

Alternative 2: 99.1% accurate, 1.1× speedup?

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

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

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

    \[\leadsto \mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(ew, \mathsf{cos.f64}\left(t\right)\right), \mathsf{cos.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), \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), \color{blue}{t}\right), ew\right)\right)\right)\right)\right)\right) \]
  4. Step-by-step derivation
    1. Simplified98.6%

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

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

    Alternative 3: 99.8% accurate, 1.1× speedup?

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

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

        \[\leadsto \mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(ew, \mathsf{cos.f64}\left(t\right)\right), \cos \tan^{-1} \left(\frac{\mathsf{neg}\left(\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t\right)}{\mathsf{neg}\left(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) \]
      2. distribute-frac-neg2N/A

        \[\leadsto \mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(ew, \mathsf{cos.f64}\left(t\right)\right), \cos \tan^{-1} \left(\mathsf{neg}\left(\frac{\mathsf{neg}\left(\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t\right)}{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) \]
      3. atan-negN/A

        \[\leadsto \mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(ew, \mathsf{cos.f64}\left(t\right)\right), \cos \left(\mathsf{neg}\left(\tan^{-1} \left(\frac{\mathsf{neg}\left(\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t\right)}{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) \]
      4. cos-negN/A

        \[\leadsto \mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(ew, \mathsf{cos.f64}\left(t\right)\right), \cos \tan^{-1} \left(\frac{\mathsf{neg}\left(\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t\right)}{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), \mathsf{cos.f64}\left(\tan^{-1} \left(\frac{\mathsf{neg}\left(\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t\right)}{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) \]
      6. atan-lowering-atan.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{cos.f64}\left(\mathsf{atan.f64}\left(\left(\frac{\mathsf{neg}\left(\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t\right)}{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) \]
      7. /-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{cos.f64}\left(\mathsf{atan.f64}\left(\mathsf{/.f64}\left(\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t\right)\right), 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) \]
      8. 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{cos.f64}\left(\mathsf{atan.f64}\left(\mathsf{/.f64}\left(\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(eh \cdot \tan t\right)\right)\right)\right), 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) \]
      9. 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{cos.f64}\left(\mathsf{atan.f64}\left(\mathsf{/.f64}\left(\left(eh \cdot \tan t\right), 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. *-commutativeN/A

        \[\leadsto \mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(ew, \mathsf{cos.f64}\left(t\right)\right), \mathsf{cos.f64}\left(\mathsf{atan.f64}\left(\mathsf{/.f64}\left(\left(\tan t \cdot eh\right), 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) \]
      11. +-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{cos.f64}\left(\mathsf{atan.f64}\left(\mathsf{/.f64}\left(\left(\tan t \cdot \left(0 + eh\right)\right), 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) \]
      12. *-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{cos.f64}\left(\mathsf{atan.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\tan t, \left(0 + eh\right)\right), 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) \]
      13. tan-lowering-tan.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{cos.f64}\left(\mathsf{atan.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{tan.f64}\left(t\right), \left(0 + eh\right)\right), 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) \]
      14. +-lft-identity99.8%

        \[\leadsto \mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(ew, \mathsf{cos.f64}\left(t\right)\right), \mathsf{cos.f64}\left(\mathsf{atan.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{tan.f64}\left(t\right), eh\right), 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) \]
    4. Applied egg-rr99.8%

      \[\leadsto \left|\left(ew \cdot \cos t\right) \cdot \color{blue}{\cos \tan^{-1} \left(\frac{\tan t \cdot eh}{ew}\right)} - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right| \]
    5. 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{\tan t \cdot eh}{ew} \cdot \frac{\tan t \cdot eh}{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. metadata-evalN/A

        \[\leadsto \mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(\left(\left(ew \cdot \cos t\right) \cdot \frac{1}{\sqrt{1 \cdot 1 + \frac{\tan t \cdot eh}{ew} \cdot \frac{\tan t \cdot eh}{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. associate-*l*N/A

        \[\leadsto \mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(\left(ew \cdot \left(\cos t \cdot \frac{1}{\sqrt{1 \cdot 1 + \frac{\tan t \cdot eh}{ew} \cdot \frac{\tan t \cdot eh}{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. *-commutativeN/A

        \[\leadsto \mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(\left(\left(\cos t \cdot \frac{1}{\sqrt{1 \cdot 1 + \frac{\tan t \cdot eh}{ew} \cdot \frac{\tan t \cdot eh}{ew}}}\right) \cdot 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) \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\left(\cos t \cdot \frac{1}{\sqrt{1 \cdot 1 + \frac{\tan t \cdot eh}{ew} \cdot \frac{\tan t \cdot eh}{ew}}}\right), 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) \]
    6. Applied egg-rr99.8%

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

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

    Alternative 4: 98.6% accurate, 1.5× speedup?

    \[\begin{array}{l} \\ \left|ew \cdot \cos t - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{0 - \tan t \cdot eh}{ew}\right)\right| \end{array} \]
    (FPCore (eh ew t)
     :precision binary64
     (fabs
      (-
       (* ew (cos t))
       (* (* eh (sin t)) (sin (atan (/ (- 0.0 (* (tan t) eh)) ew)))))))
    double code(double eh, double ew, double t) {
    	return fabs(((ew * cos(t)) - ((eh * sin(t)) * sin(atan(((0.0 - (tan(t) * eh)) / ew))))));
    }
    
    real(8) function code(eh, ew, t)
        real(8), intent (in) :: eh
        real(8), intent (in) :: ew
        real(8), intent (in) :: t
        code = abs(((ew * cos(t)) - ((eh * sin(t)) * sin(atan(((0.0d0 - (tan(t) * eh)) / ew))))))
    end function
    
    public static double code(double eh, double ew, double t) {
    	return Math.abs(((ew * Math.cos(t)) - ((eh * Math.sin(t)) * Math.sin(Math.atan(((0.0 - (Math.tan(t) * eh)) / ew))))));
    }
    
    def code(eh, ew, t):
    	return math.fabs(((ew * math.cos(t)) - ((eh * math.sin(t)) * math.sin(math.atan(((0.0 - (math.tan(t) * eh)) / ew))))))
    
    function code(eh, ew, t)
    	return abs(Float64(Float64(ew * cos(t)) - Float64(Float64(eh * sin(t)) * sin(atan(Float64(Float64(0.0 - Float64(tan(t) * eh)) / ew))))))
    end
    
    function tmp = code(eh, ew, t)
    	tmp = abs(((ew * cos(t)) - ((eh * sin(t)) * sin(atan(((0.0 - (tan(t) * eh)) / ew))))));
    end
    
    code[eh_, ew_, t_] := N[Abs[N[(N[(ew * N[Cos[t], $MachinePrecision]), $MachinePrecision] - N[(N[(eh * N[Sin[t], $MachinePrecision]), $MachinePrecision] * N[Sin[N[ArcTan[N[(N[(0.0 - N[(N[Tan[t], $MachinePrecision] * eh), $MachinePrecision]), $MachinePrecision] / ew), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
    
    \begin{array}{l}
    
    \\
    \left|ew \cdot \cos t - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{0 - \tan t \cdot eh}{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(\mathsf{*.f64}\left(\mathsf{*.f64}\left(ew, \mathsf{cos.f64}\left(t\right)\right), \left(\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)\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. /-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{/.f64}\left(1, \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), \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. frac-2negN/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(1, \left(\sqrt{1 + \frac{\mathsf{neg}\left(\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t\right)}{\mathsf{neg}\left(ew\right)} \cdot \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) \]
      4. distribute-frac-neg2N/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(1, \left(\sqrt{1 + \left(\mathsf{neg}\left(\frac{\mathsf{neg}\left(\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t\right)}{ew}\right)\right) \cdot \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) \]
      5. frac-2negN/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(1, \left(\sqrt{1 + \left(\mathsf{neg}\left(\frac{\mathsf{neg}\left(\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t\right)}{ew}\right)\right) \cdot \frac{\mathsf{neg}\left(\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t\right)}{\mathsf{neg}\left(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) \]
      6. distribute-frac-neg2N/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(1, \left(\sqrt{1 + \left(\mathsf{neg}\left(\frac{\mathsf{neg}\left(\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t\right)}{ew}\right)\right) \cdot \left(\mathsf{neg}\left(\frac{\mathsf{neg}\left(\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t\right)}{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) \]
      7. sqr-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{/.f64}\left(1, \left(\sqrt{1 + \frac{\mathsf{neg}\left(\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t\right)}{ew} \cdot \frac{\mathsf{neg}\left(\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t\right)}{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. 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(1, \left(\mathsf{hypot}\left(1, \frac{\mathsf{neg}\left(\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t\right)}{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) \]
      9. 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{/.f64}\left(1, \mathsf{hypot.f64}\left(1, \left(\frac{\mathsf{neg}\left(\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t\right)}{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. /-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{/.f64}\left(1, \mathsf{hypot.f64}\left(1, \mathsf{/.f64}\left(\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t\right)\right), 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) \]
    4. Applied egg-rr99.8%

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

      \[\leadsto \mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(\color{blue}{\left(ew \cdot \cos t\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. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(ew, \cos t\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. cos-lowering-cos.f6498.2%

        \[\leadsto \mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(ew, \mathsf{cos.f64}\left(t\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. Simplified98.2%

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

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

    Alternative 5: 75.0% accurate, 4.3× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} t_1 := \left|ew \cdot \cos t\right|\\ \mathbf{if}\;ew \leq -8.6 \cdot 10^{-102}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;ew \leq 7.8 \cdot 10^{-113}:\\ \;\;\;\;\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 -8.6e-102) t_1 (if (<= ew 7.8e-113) (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 <= -8.6e-102) {
    		tmp = t_1;
    	} else if (ew <= 7.8e-113) {
    		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 <= (-8.6d-102)) then
            tmp = t_1
        else if (ew <= 7.8d-113) 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 <= -8.6e-102) {
    		tmp = t_1;
    	} else if (ew <= 7.8e-113) {
    		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 <= -8.6e-102:
    		tmp = t_1
    	elif ew <= 7.8e-113:
    		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 <= -8.6e-102)
    		tmp = t_1;
    	elseif (ew <= 7.8e-113)
    		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 <= -8.6e-102)
    		tmp = t_1;
    	elseif (ew <= 7.8e-113)
    		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, -8.6e-102], t$95$1, If[LessEqual[ew, 7.8e-113], 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 -8.6 \cdot 10^{-102}:\\
    \;\;\;\;t\_1\\
    
    \mathbf{elif}\;ew \leq 7.8 \cdot 10^{-113}:\\
    \;\;\;\;\left|eh \cdot \sin t\right|\\
    
    \mathbf{else}:\\
    \;\;\;\;t\_1\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if ew < -8.5999999999999995e-102 or 7.7999999999999997e-113 < 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(\mathsf{*.f64}\left(\mathsf{*.f64}\left(ew, \mathsf{cos.f64}\left(t\right)\right), \left(\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)\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. /-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{/.f64}\left(1, \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), \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. frac-2negN/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(1, \left(\sqrt{1 + \frac{\mathsf{neg}\left(\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t\right)}{\mathsf{neg}\left(ew\right)} \cdot \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) \]
        4. distribute-frac-neg2N/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(1, \left(\sqrt{1 + \left(\mathsf{neg}\left(\frac{\mathsf{neg}\left(\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t\right)}{ew}\right)\right) \cdot \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) \]
        5. frac-2negN/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(1, \left(\sqrt{1 + \left(\mathsf{neg}\left(\frac{\mathsf{neg}\left(\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t\right)}{ew}\right)\right) \cdot \frac{\mathsf{neg}\left(\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t\right)}{\mathsf{neg}\left(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) \]
        6. distribute-frac-neg2N/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(1, \left(\sqrt{1 + \left(\mathsf{neg}\left(\frac{\mathsf{neg}\left(\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t\right)}{ew}\right)\right) \cdot \left(\mathsf{neg}\left(\frac{\mathsf{neg}\left(\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t\right)}{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) \]
        7. sqr-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{/.f64}\left(1, \left(\sqrt{1 + \frac{\mathsf{neg}\left(\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t\right)}{ew} \cdot \frac{\mathsf{neg}\left(\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t\right)}{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. 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(1, \left(\mathsf{hypot}\left(1, \frac{\mathsf{neg}\left(\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t\right)}{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) \]
        9. 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{/.f64}\left(1, \mathsf{hypot.f64}\left(1, \left(\frac{\mathsf{neg}\left(\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t\right)}{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. /-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{/.f64}\left(1, \mathsf{hypot.f64}\left(1, \mathsf{/.f64}\left(\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t\right)\right), 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) \]
      4. Applied egg-rr99.8%

        \[\leadsto \left|\left(ew \cdot \cos t\right) \cdot \color{blue}{\frac{1}{\mathsf{hypot}\left(1, \frac{\tan t \cdot eh}{ew}\right)}} - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right| \]
      5. Taylor expanded in 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.f6480.1%

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

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

      if -8.5999999999999995e-102 < ew < 7.7999999999999997e-113

      1. Initial program 99.8%

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

        \[\leadsto \mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(ew, \mathsf{cos.f64}\left(t\right)\right), \mathsf{cos.f64}\left(\mathsf{atan.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{neg.f64}\left(eh\right), \color{blue}{t}\right), 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) \]
      4. Step-by-step derivation
        1. Simplified96.7%

          \[\leadsto \left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \color{blue}{t}}{ew}\right) - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right| \]
        2. Step-by-step derivation
          1. 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 t}{ew} \cdot \frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot 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 t}{ew} \cdot \frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot 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. clear-numN/A

            \[\leadsto \mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(\left(\frac{1}{\frac{\sqrt{1 + \frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot t}{ew} \cdot \frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot t}{ew}}}{ew \cdot \cos t}}\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(1, \left(\frac{\sqrt{1 + \frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot t}{ew} \cdot \frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot t}{ew}}}{ew \cdot \cos t}\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. /-lowering-/.f64N/A

            \[\leadsto \mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\left(\sqrt{1 + \frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot t}{ew} \cdot \frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot t}{ew}}\right), \left(ew \cdot \cos t\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) \]
          6. hypot-1-defN/A

            \[\leadsto \mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\left(\mathsf{hypot}\left(1, \frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot t}{ew}\right)\right), \left(ew \cdot \cos t\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(1, \mathsf{/.f64}\left(\mathsf{hypot.f64}\left(1, \left(\frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot t}{ew}\right)\right), \left(ew \cdot \cos t\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. /-lowering-/.f64N/A

            \[\leadsto \mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{hypot.f64}\left(1, \mathsf{/.f64}\left(\left(\left(\mathsf{neg}\left(eh\right)\right) \cdot t\right), ew\right)\right), \left(ew \cdot \cos t\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(1, \mathsf{/.f64}\left(\mathsf{hypot.f64}\left(1, \mathsf{/.f64}\left(\left(\mathsf{neg}\left(eh \cdot t\right)\right), ew\right)\right), \left(ew \cdot \cos t\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. distribute-rgt-neg-inN/A

            \[\leadsto \mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{hypot.f64}\left(1, \mathsf{/.f64}\left(\left(eh \cdot \left(\mathsf{neg}\left(t\right)\right)\right), ew\right)\right), \left(ew \cdot \cos t\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. *-lowering-*.f64N/A

            \[\leadsto \mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{hypot.f64}\left(1, \mathsf{/.f64}\left(\mathsf{*.f64}\left(eh, \left(\mathsf{neg}\left(t\right)\right)\right), ew\right)\right), \left(ew \cdot \cos t\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. neg-lowering-neg.f64N/A

            \[\leadsto \mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{hypot.f64}\left(1, \mathsf{/.f64}\left(\mathsf{*.f64}\left(eh, \mathsf{neg.f64}\left(t\right)\right), ew\right)\right), \left(ew \cdot \cos t\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. *-lowering-*.f64N/A

            \[\leadsto \mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{hypot.f64}\left(1, \mathsf{/.f64}\left(\mathsf{*.f64}\left(eh, \mathsf{neg.f64}\left(t\right)\right), ew\right)\right), \mathsf{*.f64}\left(ew, \cos t\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. cos-lowering-cos.f6496.5%

            \[\leadsto \mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{hypot.f64}\left(1, \mathsf{/.f64}\left(\mathsf{*.f64}\left(eh, \mathsf{neg.f64}\left(t\right)\right), ew\right)\right), \mathsf{*.f64}\left(ew, \mathsf{cos.f64}\left(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) \]
        3. Applied egg-rr96.5%

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

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

          \[\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.f6478.4%

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

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

      Alternative 6: 58.3% accurate, 4.3× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;ew \leq -2.8 \cdot 10^{-101}:\\ \;\;\;\;\left|ew\right|\\ \mathbf{elif}\;ew \leq 5.5 \cdot 10^{+45}:\\ \;\;\;\;\left|eh \cdot \sin t\right|\\ \mathbf{else}:\\ \;\;\;\;\left|ew\right|\\ \end{array} \end{array} \]
      (FPCore (eh ew t)
       :precision binary64
       (if (<= ew -2.8e-101)
         (fabs ew)
         (if (<= ew 5.5e+45) (fabs (* eh (sin t))) (fabs ew))))
      double code(double eh, double ew, double t) {
      	double tmp;
      	if (ew <= -2.8e-101) {
      		tmp = fabs(ew);
      	} else if (ew <= 5.5e+45) {
      		tmp = fabs((eh * sin(t)));
      	} else {
      		tmp = fabs(ew);
      	}
      	return tmp;
      }
      
      real(8) function code(eh, ew, t)
          real(8), intent (in) :: eh
          real(8), intent (in) :: ew
          real(8), intent (in) :: t
          real(8) :: tmp
          if (ew <= (-2.8d-101)) then
              tmp = abs(ew)
          else if (ew <= 5.5d+45) then
              tmp = abs((eh * sin(t)))
          else
              tmp = abs(ew)
          end if
          code = tmp
      end function
      
      public static double code(double eh, double ew, double t) {
      	double tmp;
      	if (ew <= -2.8e-101) {
      		tmp = Math.abs(ew);
      	} else if (ew <= 5.5e+45) {
      		tmp = Math.abs((eh * Math.sin(t)));
      	} else {
      		tmp = Math.abs(ew);
      	}
      	return tmp;
      }
      
      def code(eh, ew, t):
      	tmp = 0
      	if ew <= -2.8e-101:
      		tmp = math.fabs(ew)
      	elif ew <= 5.5e+45:
      		tmp = math.fabs((eh * math.sin(t)))
      	else:
      		tmp = math.fabs(ew)
      	return tmp
      
      function code(eh, ew, t)
      	tmp = 0.0
      	if (ew <= -2.8e-101)
      		tmp = abs(ew);
      	elseif (ew <= 5.5e+45)
      		tmp = abs(Float64(eh * sin(t)));
      	else
      		tmp = abs(ew);
      	end
      	return tmp
      end
      
      function tmp_2 = code(eh, ew, t)
      	tmp = 0.0;
      	if (ew <= -2.8e-101)
      		tmp = abs(ew);
      	elseif (ew <= 5.5e+45)
      		tmp = abs((eh * sin(t)));
      	else
      		tmp = abs(ew);
      	end
      	tmp_2 = tmp;
      end
      
      code[eh_, ew_, t_] := If[LessEqual[ew, -2.8e-101], N[Abs[ew], $MachinePrecision], If[LessEqual[ew, 5.5e+45], N[Abs[N[(eh * N[Sin[t], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Abs[ew], $MachinePrecision]]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      \mathbf{if}\;ew \leq -2.8 \cdot 10^{-101}:\\
      \;\;\;\;\left|ew\right|\\
      
      \mathbf{elif}\;ew \leq 5.5 \cdot 10^{+45}:\\
      \;\;\;\;\left|eh \cdot \sin t\right|\\
      
      \mathbf{else}:\\
      \;\;\;\;\left|ew\right|\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if ew < -2.79999999999999989e-101 or 5.5000000000000001e45 < 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(\mathsf{*.f64}\left(\mathsf{*.f64}\left(ew, \mathsf{cos.f64}\left(t\right)\right), \left(\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)\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. /-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{/.f64}\left(1, \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), \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. frac-2negN/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(1, \left(\sqrt{1 + \frac{\mathsf{neg}\left(\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t\right)}{\mathsf{neg}\left(ew\right)} \cdot \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) \]
          4. distribute-frac-neg2N/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(1, \left(\sqrt{1 + \left(\mathsf{neg}\left(\frac{\mathsf{neg}\left(\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t\right)}{ew}\right)\right) \cdot \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) \]
          5. frac-2negN/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(1, \left(\sqrt{1 + \left(\mathsf{neg}\left(\frac{\mathsf{neg}\left(\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t\right)}{ew}\right)\right) \cdot \frac{\mathsf{neg}\left(\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t\right)}{\mathsf{neg}\left(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) \]
          6. distribute-frac-neg2N/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(1, \left(\sqrt{1 + \left(\mathsf{neg}\left(\frac{\mathsf{neg}\left(\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t\right)}{ew}\right)\right) \cdot \left(\mathsf{neg}\left(\frac{\mathsf{neg}\left(\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t\right)}{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) \]
          7. sqr-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{/.f64}\left(1, \left(\sqrt{1 + \frac{\mathsf{neg}\left(\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t\right)}{ew} \cdot \frac{\mathsf{neg}\left(\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t\right)}{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. 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(1, \left(\mathsf{hypot}\left(1, \frac{\mathsf{neg}\left(\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t\right)}{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) \]
          9. 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{/.f64}\left(1, \mathsf{hypot.f64}\left(1, \left(\frac{\mathsf{neg}\left(\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t\right)}{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. /-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{/.f64}\left(1, \mathsf{hypot.f64}\left(1, \mathsf{/.f64}\left(\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t\right)\right), 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) \]
        4. Applied egg-rr99.8%

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

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

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

          if -2.79999999999999989e-101 < ew < 5.5000000000000001e45

          1. Initial program 99.8%

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

            \[\leadsto \mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(ew, \mathsf{cos.f64}\left(t\right)\right), \mathsf{cos.f64}\left(\mathsf{atan.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{neg.f64}\left(eh\right), \color{blue}{t}\right), 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) \]
          4. Step-by-step derivation
            1. Simplified93.2%

              \[\leadsto \left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \color{blue}{t}}{ew}\right) - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right| \]
            2. Step-by-step derivation
              1. 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 t}{ew} \cdot \frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot 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 t}{ew} \cdot \frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot 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. clear-numN/A

                \[\leadsto \mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(\left(\frac{1}{\frac{\sqrt{1 + \frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot t}{ew} \cdot \frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot t}{ew}}}{ew \cdot \cos t}}\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(1, \left(\frac{\sqrt{1 + \frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot t}{ew} \cdot \frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot t}{ew}}}{ew \cdot \cos t}\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. /-lowering-/.f64N/A

                \[\leadsto \mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\left(\sqrt{1 + \frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot t}{ew} \cdot \frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot t}{ew}}\right), \left(ew \cdot \cos t\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) \]
              6. hypot-1-defN/A

                \[\leadsto \mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\left(\mathsf{hypot}\left(1, \frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot t}{ew}\right)\right), \left(ew \cdot \cos t\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(1, \mathsf{/.f64}\left(\mathsf{hypot.f64}\left(1, \left(\frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot t}{ew}\right)\right), \left(ew \cdot \cos t\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. /-lowering-/.f64N/A

                \[\leadsto \mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{hypot.f64}\left(1, \mathsf{/.f64}\left(\left(\left(\mathsf{neg}\left(eh\right)\right) \cdot t\right), ew\right)\right), \left(ew \cdot \cos t\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(1, \mathsf{/.f64}\left(\mathsf{hypot.f64}\left(1, \mathsf{/.f64}\left(\left(\mathsf{neg}\left(eh \cdot t\right)\right), ew\right)\right), \left(ew \cdot \cos t\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. distribute-rgt-neg-inN/A

                \[\leadsto \mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{hypot.f64}\left(1, \mathsf{/.f64}\left(\left(eh \cdot \left(\mathsf{neg}\left(t\right)\right)\right), ew\right)\right), \left(ew \cdot \cos t\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. *-lowering-*.f64N/A

                \[\leadsto \mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{hypot.f64}\left(1, \mathsf{/.f64}\left(\mathsf{*.f64}\left(eh, \left(\mathsf{neg}\left(t\right)\right)\right), ew\right)\right), \left(ew \cdot \cos t\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. neg-lowering-neg.f64N/A

                \[\leadsto \mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{hypot.f64}\left(1, \mathsf{/.f64}\left(\mathsf{*.f64}\left(eh, \mathsf{neg.f64}\left(t\right)\right), ew\right)\right), \left(ew \cdot \cos t\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. *-lowering-*.f64N/A

                \[\leadsto \mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{hypot.f64}\left(1, \mathsf{/.f64}\left(\mathsf{*.f64}\left(eh, \mathsf{neg.f64}\left(t\right)\right), ew\right)\right), \mathsf{*.f64}\left(ew, \cos t\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. cos-lowering-cos.f6493.0%

                \[\leadsto \mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{hypot.f64}\left(1, \mathsf{/.f64}\left(\mathsf{*.f64}\left(eh, \mathsf{neg.f64}\left(t\right)\right), ew\right)\right), \mathsf{*.f64}\left(ew, \mathsf{cos.f64}\left(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) \]
            3. Applied egg-rr93.0%

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

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

              \[\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.f6469.2%

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

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

          Alternative 7: 43.1% 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(\mathsf{*.f64}\left(\mathsf{*.f64}\left(ew, \mathsf{cos.f64}\left(t\right)\right), \left(\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)\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. /-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{/.f64}\left(1, \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), \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. frac-2negN/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(1, \left(\sqrt{1 + \frac{\mathsf{neg}\left(\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t\right)}{\mathsf{neg}\left(ew\right)} \cdot \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) \]
            4. distribute-frac-neg2N/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(1, \left(\sqrt{1 + \left(\mathsf{neg}\left(\frac{\mathsf{neg}\left(\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t\right)}{ew}\right)\right) \cdot \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) \]
            5. frac-2negN/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(1, \left(\sqrt{1 + \left(\mathsf{neg}\left(\frac{\mathsf{neg}\left(\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t\right)}{ew}\right)\right) \cdot \frac{\mathsf{neg}\left(\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t\right)}{\mathsf{neg}\left(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) \]
            6. distribute-frac-neg2N/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(1, \left(\sqrt{1 + \left(\mathsf{neg}\left(\frac{\mathsf{neg}\left(\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t\right)}{ew}\right)\right) \cdot \left(\mathsf{neg}\left(\frac{\mathsf{neg}\left(\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t\right)}{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) \]
            7. sqr-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{/.f64}\left(1, \left(\sqrt{1 + \frac{\mathsf{neg}\left(\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t\right)}{ew} \cdot \frac{\mathsf{neg}\left(\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t\right)}{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. 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(1, \left(\mathsf{hypot}\left(1, \frac{\mathsf{neg}\left(\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t\right)}{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) \]
            9. 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{/.f64}\left(1, \mathsf{hypot.f64}\left(1, \left(\frac{\mathsf{neg}\left(\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t\right)}{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. /-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{/.f64}\left(1, \mathsf{hypot.f64}\left(1, \mathsf{/.f64}\left(\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t\right)\right), 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) \]
          4. Applied egg-rr99.8%

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

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

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

            Reproduce

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