Example from Robby

Percentage Accurate: 99.8% → 99.8%
Time: 19.9s
Alternatives: 10
Speedup: N/A×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 10 alternatives:

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

Initial Program: 99.8% accurate, 1.0× speedup?

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

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

Alternative 1: 99.8% accurate, 1.1× speedup?

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \mathsf{fabs.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{sin.f64}\left(t\right), \mathsf{hypot.f64}\left(1, \mathsf{/.f64}\left(\mathsf{/.f64}\left(eh, ew\right), \tan t\right)\right)\right), ew\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(eh, \mathsf{cos.f64}\left(t\right)\right), \mathsf{sin.f64}\left(\mathsf{atan.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(eh, ew\right), \mathsf{tan.f64}\left(t\right)\right)\right)\right)\right)\right)\right) \]
    12. tan-lowering-tan.f6499.8%

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

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

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

Alternative 2: 99.1% accurate, 1.1× speedup?

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

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

    \[\left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\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{sin.f64}\left(t\right)\right), \mathsf{cos.f64}\left(\mathsf{atan.f64}\left(\color{blue}{\left(\frac{eh}{ew \cdot t}\right)}\right)\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(eh, \mathsf{cos.f64}\left(t\right)\right), \mathsf{sin.f64}\left(\mathsf{atan.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(eh, ew\right), \mathsf{tan.f64}\left(t\right)\right)\right)\right)\right)\right)\right) \]
  4. Step-by-step derivation
    1. /-lowering-/.f64N/A

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

      \[\leadsto \mathsf{fabs.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(ew, \mathsf{sin.f64}\left(t\right)\right), \mathsf{cos.f64}\left(\mathsf{atan.f64}\left(\mathsf{/.f64}\left(eh, \left(t \cdot ew\right)\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(eh, \mathsf{cos.f64}\left(t\right)\right), \mathsf{sin.f64}\left(\mathsf{atan.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(eh, ew\right), \mathsf{tan.f64}\left(t\right)\right)\right)\right)\right)\right)\right) \]
    3. *-lowering-*.f6499.0%

      \[\leadsto \mathsf{fabs.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(ew, \mathsf{sin.f64}\left(t\right)\right), \mathsf{cos.f64}\left(\mathsf{atan.f64}\left(\mathsf{/.f64}\left(eh, \mathsf{*.f64}\left(t, ew\right)\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(eh, \mathsf{cos.f64}\left(t\right)\right), \mathsf{sin.f64}\left(\mathsf{atan.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(eh, ew\right), \mathsf{tan.f64}\left(t\right)\right)\right)\right)\right)\right)\right) \]
  5. Simplified99.0%

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

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

Alternative 3: 98.5% accurate, 1.5× speedup?

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \mathsf{fabs.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{sin.f64}\left(t\right), \mathsf{hypot.f64}\left(1, \mathsf{/.f64}\left(\mathsf{/.f64}\left(eh, ew\right), \tan t\right)\right)\right), ew\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(eh, \mathsf{cos.f64}\left(t\right)\right), \mathsf{sin.f64}\left(\mathsf{atan.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(eh, ew\right), \mathsf{tan.f64}\left(t\right)\right)\right)\right)\right)\right)\right) \]
    12. tan-lowering-tan.f6499.8%

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

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

    \[\leadsto \mathsf{fabs.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\color{blue}{\sin t}, ew\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(eh, \mathsf{cos.f64}\left(t\right)\right), \mathsf{sin.f64}\left(\mathsf{atan.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(eh, ew\right), \mathsf{tan.f64}\left(t\right)\right)\right)\right)\right)\right)\right) \]
  6. Step-by-step derivation
    1. sin-lowering-sin.f6497.8%

      \[\leadsto \mathsf{fabs.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{sin.f64}\left(t\right), ew\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(eh, \mathsf{cos.f64}\left(t\right)\right), \mathsf{sin.f64}\left(\mathsf{atan.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(eh, ew\right), \mathsf{tan.f64}\left(t\right)\right)\right)\right)\right)\right)\right) \]
  7. Simplified97.8%

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

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

Alternative 4: 86.3% accurate, 1.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \left|\left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{eh}{ew \cdot \tan t}\right)\right|\\ \mathbf{if}\;eh \leq -5.1 \cdot 10^{+158}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;eh \leq 8.5 \cdot 10^{+76}:\\ \;\;\;\;\left|\sin t \cdot ew + eh \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right|\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (eh ew t)
 :precision binary64
 (let* ((t_1 (fabs (* (* eh (cos t)) (sin (atan (/ eh (* ew (tan t)))))))))
   (if (<= eh -5.1e+158)
     t_1
     (if (<= eh 8.5e+76)
       (fabs (+ (* (sin t) ew) (* eh (sin (atan (/ (/ eh ew) (tan t)))))))
       t_1))))
double code(double eh, double ew, double t) {
	double t_1 = fabs(((eh * cos(t)) * sin(atan((eh / (ew * tan(t)))))));
	double tmp;
	if (eh <= -5.1e+158) {
		tmp = t_1;
	} else if (eh <= 8.5e+76) {
		tmp = fabs(((sin(t) * ew) + (eh * sin(atan(((eh / ew) / tan(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(((eh * cos(t)) * sin(atan((eh / (ew * tan(t)))))))
    if (eh <= (-5.1d+158)) then
        tmp = t_1
    else if (eh <= 8.5d+76) then
        tmp = abs(((sin(t) * ew) + (eh * sin(atan(((eh / ew) / tan(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(((eh * Math.cos(t)) * Math.sin(Math.atan((eh / (ew * Math.tan(t)))))));
	double tmp;
	if (eh <= -5.1e+158) {
		tmp = t_1;
	} else if (eh <= 8.5e+76) {
		tmp = Math.abs(((Math.sin(t) * ew) + (eh * Math.sin(Math.atan(((eh / ew) / Math.tan(t)))))));
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(eh, ew, t):
	t_1 = math.fabs(((eh * math.cos(t)) * math.sin(math.atan((eh / (ew * math.tan(t)))))))
	tmp = 0
	if eh <= -5.1e+158:
		tmp = t_1
	elif eh <= 8.5e+76:
		tmp = math.fabs(((math.sin(t) * ew) + (eh * math.sin(math.atan(((eh / ew) / math.tan(t)))))))
	else:
		tmp = t_1
	return tmp
function code(eh, ew, t)
	t_1 = abs(Float64(Float64(eh * cos(t)) * sin(atan(Float64(eh / Float64(ew * tan(t)))))))
	tmp = 0.0
	if (eh <= -5.1e+158)
		tmp = t_1;
	elseif (eh <= 8.5e+76)
		tmp = abs(Float64(Float64(sin(t) * ew) + Float64(eh * sin(atan(Float64(Float64(eh / ew) / tan(t)))))));
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(eh, ew, t)
	t_1 = abs(((eh * cos(t)) * sin(atan((eh / (ew * tan(t)))))));
	tmp = 0.0;
	if (eh <= -5.1e+158)
		tmp = t_1;
	elseif (eh <= 8.5e+76)
		tmp = abs(((sin(t) * ew) + (eh * sin(atan(((eh / ew) / tan(t)))))));
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[eh_, ew_, t_] := Block[{t$95$1 = N[Abs[N[(N[(eh * N[Cos[t], $MachinePrecision]), $MachinePrecision] * N[Sin[N[ArcTan[N[(eh / N[(ew * N[Tan[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[eh, -5.1e+158], t$95$1, If[LessEqual[eh, 8.5e+76], N[Abs[N[(N[(N[Sin[t], $MachinePrecision] * ew), $MachinePrecision] + N[(eh * N[Sin[N[ArcTan[N[(N[(eh / ew), $MachinePrecision] / N[Tan[t], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], t$95$1]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \left|\left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{eh}{ew \cdot \tan t}\right)\right|\\
\mathbf{if}\;eh \leq -5.1 \cdot 10^{+158}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;eh \leq 8.5 \cdot 10^{+76}:\\
\;\;\;\;\left|\sin t \cdot ew + eh \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right|\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if eh < -5.09999999999999987e158 or 8.49999999999999992e76 < eh

    1. Initial program 99.8%

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

      \[\leadsto \mathsf{fabs.f64}\left(\color{blue}{\left(eh \cdot \left(\cos t \cdot \sin \tan^{-1} \left(\frac{eh}{ew \cdot \tan t}\right)\right)\right)}\right) \]
    4. Step-by-step derivation
      1. associate-*r*N/A

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fabs.f64}\left(\mathsf{*.f64}\left(\mathsf{sin.f64}\left(\mathsf{atan.f64}\left(\mathsf{/.f64}\left(eh, \mathsf{*.f64}\left(ew, \mathsf{tan.f64}\left(t\right)\right)\right)\right)\right), \mathsf{*.f64}\left(eh, \cos t\right)\right)\right) \]
      10. cos-lowering-cos.f6492.9%

        \[\leadsto \mathsf{fabs.f64}\left(\mathsf{*.f64}\left(\mathsf{sin.f64}\left(\mathsf{atan.f64}\left(\mathsf{/.f64}\left(eh, \mathsf{*.f64}\left(ew, \mathsf{tan.f64}\left(t\right)\right)\right)\right)\right), \mathsf{*.f64}\left(eh, \mathsf{cos.f64}\left(t\right)\right)\right)\right) \]
    5. Simplified92.9%

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

    if -5.09999999999999987e158 < eh < 8.49999999999999992e76

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fabs.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{sin.f64}\left(t\right), \mathsf{hypot.f64}\left(1, \mathsf{/.f64}\left(\mathsf{/.f64}\left(eh, ew\right), \tan t\right)\right)\right), ew\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(eh, \mathsf{cos.f64}\left(t\right)\right), \mathsf{sin.f64}\left(\mathsf{atan.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(eh, ew\right), \mathsf{tan.f64}\left(t\right)\right)\right)\right)\right)\right)\right) \]
      12. tan-lowering-tan.f6499.9%

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

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

      \[\leadsto \mathsf{fabs.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{sin.f64}\left(t\right), \mathsf{hypot.f64}\left(1, \mathsf{/.f64}\left(\mathsf{/.f64}\left(eh, ew\right), \mathsf{tan.f64}\left(t\right)\right)\right)\right), ew\right), \mathsf{*.f64}\left(\color{blue}{eh}, \mathsf{sin.f64}\left(\mathsf{atan.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(eh, ew\right), \mathsf{tan.f64}\left(t\right)\right)\right)\right)\right)\right)\right) \]
    6. Step-by-step derivation
      1. Simplified90.7%

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

        \[\leadsto \mathsf{fabs.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\color{blue}{\sin t}, ew\right), \mathsf{*.f64}\left(eh, \mathsf{sin.f64}\left(\mathsf{atan.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(eh, ew\right), \mathsf{tan.f64}\left(t\right)\right)\right)\right)\right)\right)\right) \]
      3. Step-by-step derivation
        1. sin-lowering-sin.f6489.3%

          \[\leadsto \mathsf{fabs.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{sin.f64}\left(t\right), ew\right), \mathsf{*.f64}\left(eh, \mathsf{sin.f64}\left(\mathsf{atan.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(eh, ew\right), \mathsf{tan.f64}\left(t\right)\right)\right)\right)\right)\right)\right) \]
      4. Simplified89.3%

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

      \[\leadsto \begin{array}{l} \mathbf{if}\;eh \leq -5.1 \cdot 10^{+158}:\\ \;\;\;\;\left|\left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{eh}{ew \cdot \tan t}\right)\right|\\ \mathbf{elif}\;eh \leq 8.5 \cdot 10^{+76}:\\ \;\;\;\;\left|\sin t \cdot ew + eh \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right|\\ \mathbf{else}:\\ \;\;\;\;\left|\left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{eh}{ew \cdot \tan t}\right)\right|\\ \end{array} \]
    9. Add Preprocessing

    Alternative 5: 75.1% accurate, 1.8× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} t_1 := \left|\left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{eh}{ew \cdot \tan t}\right)\right|\\ \mathbf{if}\;eh \leq -2.5 \cdot 10^{-59}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;eh \leq 9 \cdot 10^{-61}:\\ \;\;\;\;\left|\sin t \cdot ew\right|\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
    (FPCore (eh ew t)
     :precision binary64
     (let* ((t_1 (fabs (* (* eh (cos t)) (sin (atan (/ eh (* ew (tan t)))))))))
       (if (<= eh -2.5e-59) t_1 (if (<= eh 9e-61) (fabs (* (sin t) ew)) t_1))))
    double code(double eh, double ew, double t) {
    	double t_1 = fabs(((eh * cos(t)) * sin(atan((eh / (ew * tan(t)))))));
    	double tmp;
    	if (eh <= -2.5e-59) {
    		tmp = t_1;
    	} else if (eh <= 9e-61) {
    		tmp = fabs((sin(t) * ew));
    	} else {
    		tmp = t_1;
    	}
    	return tmp;
    }
    
    real(8) function code(eh, ew, t)
        real(8), intent (in) :: eh
        real(8), intent (in) :: ew
        real(8), intent (in) :: t
        real(8) :: t_1
        real(8) :: tmp
        t_1 = abs(((eh * cos(t)) * sin(atan((eh / (ew * tan(t)))))))
        if (eh <= (-2.5d-59)) then
            tmp = t_1
        else if (eh <= 9d-61) then
            tmp = abs((sin(t) * ew))
        else
            tmp = t_1
        end if
        code = tmp
    end function
    
    public static double code(double eh, double ew, double t) {
    	double t_1 = Math.abs(((eh * Math.cos(t)) * Math.sin(Math.atan((eh / (ew * Math.tan(t)))))));
    	double tmp;
    	if (eh <= -2.5e-59) {
    		tmp = t_1;
    	} else if (eh <= 9e-61) {
    		tmp = Math.abs((Math.sin(t) * ew));
    	} else {
    		tmp = t_1;
    	}
    	return tmp;
    }
    
    def code(eh, ew, t):
    	t_1 = math.fabs(((eh * math.cos(t)) * math.sin(math.atan((eh / (ew * math.tan(t)))))))
    	tmp = 0
    	if eh <= -2.5e-59:
    		tmp = t_1
    	elif eh <= 9e-61:
    		tmp = math.fabs((math.sin(t) * ew))
    	else:
    		tmp = t_1
    	return tmp
    
    function code(eh, ew, t)
    	t_1 = abs(Float64(Float64(eh * cos(t)) * sin(atan(Float64(eh / Float64(ew * tan(t)))))))
    	tmp = 0.0
    	if (eh <= -2.5e-59)
    		tmp = t_1;
    	elseif (eh <= 9e-61)
    		tmp = abs(Float64(sin(t) * ew));
    	else
    		tmp = t_1;
    	end
    	return tmp
    end
    
    function tmp_2 = code(eh, ew, t)
    	t_1 = abs(((eh * cos(t)) * sin(atan((eh / (ew * tan(t)))))));
    	tmp = 0.0;
    	if (eh <= -2.5e-59)
    		tmp = t_1;
    	elseif (eh <= 9e-61)
    		tmp = abs((sin(t) * ew));
    	else
    		tmp = t_1;
    	end
    	tmp_2 = tmp;
    end
    
    code[eh_, ew_, t_] := Block[{t$95$1 = N[Abs[N[(N[(eh * N[Cos[t], $MachinePrecision]), $MachinePrecision] * N[Sin[N[ArcTan[N[(eh / N[(ew * N[Tan[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[eh, -2.5e-59], t$95$1, If[LessEqual[eh, 9e-61], N[Abs[N[(N[Sin[t], $MachinePrecision] * ew), $MachinePrecision]], $MachinePrecision], t$95$1]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    t_1 := \left|\left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{eh}{ew \cdot \tan t}\right)\right|\\
    \mathbf{if}\;eh \leq -2.5 \cdot 10^{-59}:\\
    \;\;\;\;t\_1\\
    
    \mathbf{elif}\;eh \leq 9 \cdot 10^{-61}:\\
    \;\;\;\;\left|\sin t \cdot ew\right|\\
    
    \mathbf{else}:\\
    \;\;\;\;t\_1\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if eh < -2.5000000000000001e-59 or 9e-61 < eh

      1. Initial program 99.8%

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

        \[\leadsto \mathsf{fabs.f64}\left(\color{blue}{\left(eh \cdot \left(\cos t \cdot \sin \tan^{-1} \left(\frac{eh}{ew \cdot \tan t}\right)\right)\right)}\right) \]
      4. Step-by-step derivation
        1. associate-*r*N/A

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

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

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

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

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

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

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

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

          \[\leadsto \mathsf{fabs.f64}\left(\mathsf{*.f64}\left(\mathsf{sin.f64}\left(\mathsf{atan.f64}\left(\mathsf{/.f64}\left(eh, \mathsf{*.f64}\left(ew, \mathsf{tan.f64}\left(t\right)\right)\right)\right)\right), \mathsf{*.f64}\left(eh, \cos t\right)\right)\right) \]
        10. cos-lowering-cos.f6482.0%

          \[\leadsto \mathsf{fabs.f64}\left(\mathsf{*.f64}\left(\mathsf{sin.f64}\left(\mathsf{atan.f64}\left(\mathsf{/.f64}\left(eh, \mathsf{*.f64}\left(ew, \mathsf{tan.f64}\left(t\right)\right)\right)\right)\right), \mathsf{*.f64}\left(eh, \mathsf{cos.f64}\left(t\right)\right)\right)\right) \]
      5. Simplified82.0%

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

      if -2.5000000000000001e-59 < eh < 9e-61

      1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

          \[\leadsto \mathsf{fabs.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{sin.f64}\left(t\right), \mathsf{hypot.f64}\left(1, \mathsf{/.f64}\left(\mathsf{/.f64}\left(eh, ew\right), \tan t\right)\right)\right), ew\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(eh, \mathsf{cos.f64}\left(t\right)\right), \mathsf{sin.f64}\left(\mathsf{atan.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(eh, ew\right), \mathsf{tan.f64}\left(t\right)\right)\right)\right)\right)\right)\right) \]
        12. tan-lowering-tan.f6499.9%

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

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

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

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

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

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

      \[\leadsto \begin{array}{l} \mathbf{if}\;eh \leq -2.5 \cdot 10^{-59}:\\ \;\;\;\;\left|\left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{eh}{ew \cdot \tan t}\right)\right|\\ \mathbf{elif}\;eh \leq 9 \cdot 10^{-61}:\\ \;\;\;\;\left|\sin t \cdot ew\right|\\ \mathbf{else}:\\ \;\;\;\;\left|\left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{eh}{ew \cdot \tan t}\right)\right|\\ \end{array} \]
    5. Add Preprocessing

    Alternative 6: 61.4% accurate, 2.2× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;eh \leq -2 \cdot 10^{-59}:\\ \;\;\;\;\left|eh\right|\\ \mathbf{elif}\;eh \leq 8.2 \cdot 10^{-60}:\\ \;\;\;\;\left|\sin t \cdot ew\right|\\ \mathbf{else}:\\ \;\;\;\;\cos t \cdot \left(eh \cdot \left(0.5 - 0.5 \cdot \cos \left(\tan^{-1} \left(\frac{eh}{ew \cdot \tan t}\right) \cdot 2\right)\right)\right)\\ \end{array} \end{array} \]
    (FPCore (eh ew t)
     :precision binary64
     (if (<= eh -2e-59)
       (fabs eh)
       (if (<= eh 8.2e-60)
         (fabs (* (sin t) ew))
         (*
          (cos t)
          (* eh (- 0.5 (* 0.5 (cos (* (atan (/ eh (* ew (tan t)))) 2.0)))))))))
    double code(double eh, double ew, double t) {
    	double tmp;
    	if (eh <= -2e-59) {
    		tmp = fabs(eh);
    	} else if (eh <= 8.2e-60) {
    		tmp = fabs((sin(t) * ew));
    	} else {
    		tmp = cos(t) * (eh * (0.5 - (0.5 * cos((atan((eh / (ew * tan(t)))) * 2.0)))));
    	}
    	return tmp;
    }
    
    real(8) function code(eh, ew, t)
        real(8), intent (in) :: eh
        real(8), intent (in) :: ew
        real(8), intent (in) :: t
        real(8) :: tmp
        if (eh <= (-2d-59)) then
            tmp = abs(eh)
        else if (eh <= 8.2d-60) then
            tmp = abs((sin(t) * ew))
        else
            tmp = cos(t) * (eh * (0.5d0 - (0.5d0 * cos((atan((eh / (ew * tan(t)))) * 2.0d0)))))
        end if
        code = tmp
    end function
    
    public static double code(double eh, double ew, double t) {
    	double tmp;
    	if (eh <= -2e-59) {
    		tmp = Math.abs(eh);
    	} else if (eh <= 8.2e-60) {
    		tmp = Math.abs((Math.sin(t) * ew));
    	} else {
    		tmp = Math.cos(t) * (eh * (0.5 - (0.5 * Math.cos((Math.atan((eh / (ew * Math.tan(t)))) * 2.0)))));
    	}
    	return tmp;
    }
    
    def code(eh, ew, t):
    	tmp = 0
    	if eh <= -2e-59:
    		tmp = math.fabs(eh)
    	elif eh <= 8.2e-60:
    		tmp = math.fabs((math.sin(t) * ew))
    	else:
    		tmp = math.cos(t) * (eh * (0.5 - (0.5 * math.cos((math.atan((eh / (ew * math.tan(t)))) * 2.0)))))
    	return tmp
    
    function code(eh, ew, t)
    	tmp = 0.0
    	if (eh <= -2e-59)
    		tmp = abs(eh);
    	elseif (eh <= 8.2e-60)
    		tmp = abs(Float64(sin(t) * ew));
    	else
    		tmp = Float64(cos(t) * Float64(eh * Float64(0.5 - Float64(0.5 * cos(Float64(atan(Float64(eh / Float64(ew * tan(t)))) * 2.0))))));
    	end
    	return tmp
    end
    
    function tmp_2 = code(eh, ew, t)
    	tmp = 0.0;
    	if (eh <= -2e-59)
    		tmp = abs(eh);
    	elseif (eh <= 8.2e-60)
    		tmp = abs((sin(t) * ew));
    	else
    		tmp = cos(t) * (eh * (0.5 - (0.5 * cos((atan((eh / (ew * tan(t)))) * 2.0)))));
    	end
    	tmp_2 = tmp;
    end
    
    code[eh_, ew_, t_] := If[LessEqual[eh, -2e-59], N[Abs[eh], $MachinePrecision], If[LessEqual[eh, 8.2e-60], N[Abs[N[(N[Sin[t], $MachinePrecision] * ew), $MachinePrecision]], $MachinePrecision], N[(N[Cos[t], $MachinePrecision] * N[(eh * N[(0.5 - N[(0.5 * N[Cos[N[(N[ArcTan[N[(eh / N[(ew * N[Tan[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    \mathbf{if}\;eh \leq -2 \cdot 10^{-59}:\\
    \;\;\;\;\left|eh\right|\\
    
    \mathbf{elif}\;eh \leq 8.2 \cdot 10^{-60}:\\
    \;\;\;\;\left|\sin t \cdot ew\right|\\
    
    \mathbf{else}:\\
    \;\;\;\;\cos t \cdot \left(eh \cdot \left(0.5 - 0.5 \cdot \cos \left(\tan^{-1} \left(\frac{eh}{ew \cdot \tan t}\right) \cdot 2\right)\right)\right)\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 3 regimes
    2. if eh < -2.0000000000000001e-59

      1. Initial program 99.8%

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

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

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

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

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

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

          \[\leadsto \mathsf{fabs.f64}\left(\mathsf{*.f64}\left(eh, \mathsf{sin.f64}\left(\mathsf{atan.f64}\left(\mathsf{/.f64}\left(eh, \mathsf{*.f64}\left(ew, \tan t\right)\right)\right)\right)\right)\right) \]
        6. tan-lowering-tan.f6449.4%

          \[\leadsto \mathsf{fabs.f64}\left(\mathsf{*.f64}\left(eh, \mathsf{sin.f64}\left(\mathsf{atan.f64}\left(\mathsf{/.f64}\left(eh, \mathsf{*.f64}\left(ew, \mathsf{tan.f64}\left(t\right)\right)\right)\right)\right)\right)\right) \]
      5. Simplified49.4%

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

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

          \[\leadsto \mathsf{fabs.f64}\left(\mathsf{*.f64}\left(eh, \left(\frac{\frac{\frac{eh}{ew}}{\tan t}}{\sqrt{1 + \frac{\frac{eh}{ew}}{\tan t} \cdot \frac{\frac{eh}{ew}}{\tan t}}}\right)\right)\right) \]
        3. associate-/r*N/A

          \[\leadsto \mathsf{fabs.f64}\left(\mathsf{*.f64}\left(eh, \left(\frac{\frac{eh}{ew \cdot \tan t}}{\sqrt{1 + \frac{\frac{eh}{ew}}{\tan t} \cdot \frac{\frac{eh}{ew}}{\tan t}}}\right)\right)\right) \]
        4. metadata-evalN/A

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

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

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

          \[\leadsto \mathsf{fabs.f64}\left(\mathsf{*.f64}\left(eh, \mathsf{/.f64}\left(eh, \mathsf{*.f64}\left(\left(\sqrt{1 \cdot 1 + \frac{\frac{eh}{ew}}{\tan t} \cdot \frac{\frac{eh}{ew}}{\tan t}}\right), \left(ew \cdot \tan t\right)\right)\right)\right)\right) \]
      7. Applied egg-rr30.9%

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

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

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

        if -2.0000000000000001e-59 < eh < 8.20000000000000025e-60

        1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

            \[\leadsto \mathsf{fabs.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{sin.f64}\left(t\right), \mathsf{hypot.f64}\left(1, \mathsf{/.f64}\left(\mathsf{/.f64}\left(eh, ew\right), \tan t\right)\right)\right), ew\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(eh, \mathsf{cos.f64}\left(t\right)\right), \mathsf{sin.f64}\left(\mathsf{atan.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(eh, ew\right), \mathsf{tan.f64}\left(t\right)\right)\right)\right)\right)\right)\right) \]
          12. tan-lowering-tan.f6499.9%

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

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

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

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

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

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

        if 8.20000000000000025e-60 < eh

        1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

            \[\leadsto \mathsf{fabs.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(eh, \mathsf{cos.f64}\left(t\right)\right), \mathsf{pow.f64}\left(\mathsf{sin.f64}\left(\mathsf{atan.f64}\left(\mathsf{/.f64}\left(eh, \mathsf{*.f64}\left(ew, \tan t\right)\right)\right)\right), 2\right)\right)\right)\right)\right) \]
          11. tan-lowering-tan.f6480.8%

            \[\leadsto \mathsf{fabs.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(eh, \mathsf{cos.f64}\left(t\right)\right), \mathsf{pow.f64}\left(\mathsf{sin.f64}\left(\mathsf{atan.f64}\left(\mathsf{/.f64}\left(eh, \mathsf{*.f64}\left(ew, \mathsf{tan.f64}\left(t\right)\right)\right)\right)\right), 2\right)\right)\right)\right)\right) \]
        6. Simplified80.8%

          \[\leadsto \left|\frac{1}{\color{blue}{\frac{1}{\left(eh \cdot \cos t\right) \cdot {\sin \tan^{-1} \left(\frac{eh}{ew \cdot \tan t}\right)}^{2}}}}\right| \]
        7. Step-by-step derivation
          1. inv-powN/A

            \[\leadsto \left|{\left(\frac{1}{\left(eh \cdot \cos t\right) \cdot {\sin \tan^{-1} \left(\frac{eh}{ew \cdot \tan t}\right)}^{2}}\right)}^{-1}\right| \]
          2. sqr-powN/A

            \[\leadsto \left|{\left(\frac{1}{\left(eh \cdot \cos t\right) \cdot {\sin \tan^{-1} \left(\frac{eh}{ew \cdot \tan t}\right)}^{2}}\right)}^{\left(\frac{-1}{2}\right)} \cdot {\left(\frac{1}{\left(eh \cdot \cos t\right) \cdot {\sin \tan^{-1} \left(\frac{eh}{ew \cdot \tan t}\right)}^{2}}\right)}^{\left(\frac{-1}{2}\right)}\right| \]
          3. fabs-sqrN/A

            \[\leadsto {\left(\frac{1}{\left(eh \cdot \cos t\right) \cdot {\sin \tan^{-1} \left(\frac{eh}{ew \cdot \tan t}\right)}^{2}}\right)}^{\left(\frac{-1}{2}\right)} \cdot \color{blue}{{\left(\frac{1}{\left(eh \cdot \cos t\right) \cdot {\sin \tan^{-1} \left(\frac{eh}{ew \cdot \tan t}\right)}^{2}}\right)}^{\left(\frac{-1}{2}\right)}} \]
          4. sqr-powN/A

            \[\leadsto {\left(\frac{1}{\left(eh \cdot \cos t\right) \cdot {\sin \tan^{-1} \left(\frac{eh}{ew \cdot \tan t}\right)}^{2}}\right)}^{\color{blue}{-1}} \]
          5. inv-powN/A

            \[\leadsto \frac{1}{\color{blue}{\frac{1}{\left(eh \cdot \cos t\right) \cdot {\sin \tan^{-1} \left(\frac{eh}{ew \cdot \tan t}\right)}^{2}}}} \]
          6. remove-double-divN/A

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

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

            \[\leadsto \left({\sin \tan^{-1} \left(\frac{eh}{ew \cdot \tan t}\right)}^{2} \cdot eh\right) \cdot \color{blue}{\cos t} \]
          9. *-lowering-*.f64N/A

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

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

        \[\leadsto \begin{array}{l} \mathbf{if}\;eh \leq -2 \cdot 10^{-59}:\\ \;\;\;\;\left|eh\right|\\ \mathbf{elif}\;eh \leq 8.2 \cdot 10^{-60}:\\ \;\;\;\;\left|\sin t \cdot ew\right|\\ \mathbf{else}:\\ \;\;\;\;\cos t \cdot \left(eh \cdot \left(0.5 - 0.5 \cdot \cos \left(\tan^{-1} \left(\frac{eh}{ew \cdot \tan t}\right) \cdot 2\right)\right)\right)\\ \end{array} \]
      12. Add Preprocessing

      Alternative 7: 61.3% accurate, 4.2× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} t_1 := \sin t \cdot ew\\ \mathbf{if}\;t \leq -4.1 \cdot 10^{-41}:\\ \;\;\;\;\left|t\_1\right|\\ \mathbf{elif}\;t \leq 1.75 \cdot 10^{-7}:\\ \;\;\;\;\left|eh\right|\\ \mathbf{else}:\\ \;\;\;\;\left|\frac{1}{\frac{1}{t\_1}}\right|\\ \end{array} \end{array} \]
      (FPCore (eh ew t)
       :precision binary64
       (let* ((t_1 (* (sin t) ew)))
         (if (<= t -4.1e-41)
           (fabs t_1)
           (if (<= t 1.75e-7) (fabs eh) (fabs (/ 1.0 (/ 1.0 t_1)))))))
      double code(double eh, double ew, double t) {
      	double t_1 = sin(t) * ew;
      	double tmp;
      	if (t <= -4.1e-41) {
      		tmp = fabs(t_1);
      	} else if (t <= 1.75e-7) {
      		tmp = fabs(eh);
      	} else {
      		tmp = fabs((1.0 / (1.0 / 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 = sin(t) * ew
          if (t <= (-4.1d-41)) then
              tmp = abs(t_1)
          else if (t <= 1.75d-7) then
              tmp = abs(eh)
          else
              tmp = abs((1.0d0 / (1.0d0 / t_1)))
          end if
          code = tmp
      end function
      
      public static double code(double eh, double ew, double t) {
      	double t_1 = Math.sin(t) * ew;
      	double tmp;
      	if (t <= -4.1e-41) {
      		tmp = Math.abs(t_1);
      	} else if (t <= 1.75e-7) {
      		tmp = Math.abs(eh);
      	} else {
      		tmp = Math.abs((1.0 / (1.0 / t_1)));
      	}
      	return tmp;
      }
      
      def code(eh, ew, t):
      	t_1 = math.sin(t) * ew
      	tmp = 0
      	if t <= -4.1e-41:
      		tmp = math.fabs(t_1)
      	elif t <= 1.75e-7:
      		tmp = math.fabs(eh)
      	else:
      		tmp = math.fabs((1.0 / (1.0 / t_1)))
      	return tmp
      
      function code(eh, ew, t)
      	t_1 = Float64(sin(t) * ew)
      	tmp = 0.0
      	if (t <= -4.1e-41)
      		tmp = abs(t_1);
      	elseif (t <= 1.75e-7)
      		tmp = abs(eh);
      	else
      		tmp = abs(Float64(1.0 / Float64(1.0 / t_1)));
      	end
      	return tmp
      end
      
      function tmp_2 = code(eh, ew, t)
      	t_1 = sin(t) * ew;
      	tmp = 0.0;
      	if (t <= -4.1e-41)
      		tmp = abs(t_1);
      	elseif (t <= 1.75e-7)
      		tmp = abs(eh);
      	else
      		tmp = abs((1.0 / (1.0 / t_1)));
      	end
      	tmp_2 = tmp;
      end
      
      code[eh_, ew_, t_] := Block[{t$95$1 = N[(N[Sin[t], $MachinePrecision] * ew), $MachinePrecision]}, If[LessEqual[t, -4.1e-41], N[Abs[t$95$1], $MachinePrecision], If[LessEqual[t, 1.75e-7], N[Abs[eh], $MachinePrecision], N[Abs[N[(1.0 / N[(1.0 / t$95$1), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      t_1 := \sin t \cdot ew\\
      \mathbf{if}\;t \leq -4.1 \cdot 10^{-41}:\\
      \;\;\;\;\left|t\_1\right|\\
      
      \mathbf{elif}\;t \leq 1.75 \cdot 10^{-7}:\\
      \;\;\;\;\left|eh\right|\\
      
      \mathbf{else}:\\
      \;\;\;\;\left|\frac{1}{\frac{1}{t\_1}}\right|\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 3 regimes
      2. if t < -4.10000000000000014e-41

        1. Initial program 99.7%

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

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

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

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

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

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

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

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

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

            \[\leadsto \mathsf{fabs.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{sin.f64}\left(t\right), \mathsf{hypot.f64}\left(1, \mathsf{/.f64}\left(\mathsf{/.f64}\left(eh, ew\right), \tan t\right)\right)\right), ew\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(eh, \mathsf{cos.f64}\left(t\right)\right), \mathsf{sin.f64}\left(\mathsf{atan.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(eh, ew\right), \mathsf{tan.f64}\left(t\right)\right)\right)\right)\right)\right)\right) \]
          12. tan-lowering-tan.f6499.8%

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

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

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

            \[\leadsto \mathsf{fabs.f64}\left(\mathsf{*.f64}\left(ew, \sin t\right)\right) \]
          2. sin-lowering-sin.f6451.9%

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

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

        if -4.10000000000000014e-41 < t < 1.74999999999999992e-7

        1. Initial program 100.0%

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

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

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

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

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

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

            \[\leadsto \mathsf{fabs.f64}\left(\mathsf{*.f64}\left(eh, \mathsf{sin.f64}\left(\mathsf{atan.f64}\left(\mathsf{/.f64}\left(eh, \mathsf{*.f64}\left(ew, \tan t\right)\right)\right)\right)\right)\right) \]
          6. tan-lowering-tan.f6474.5%

            \[\leadsto \mathsf{fabs.f64}\left(\mathsf{*.f64}\left(eh, \mathsf{sin.f64}\left(\mathsf{atan.f64}\left(\mathsf{/.f64}\left(eh, \mathsf{*.f64}\left(ew, \mathsf{tan.f64}\left(t\right)\right)\right)\right)\right)\right)\right) \]
        5. Simplified74.5%

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

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

            \[\leadsto \mathsf{fabs.f64}\left(\mathsf{*.f64}\left(eh, \left(\frac{\frac{\frac{eh}{ew}}{\tan t}}{\sqrt{1 + \frac{\frac{eh}{ew}}{\tan t} \cdot \frac{\frac{eh}{ew}}{\tan t}}}\right)\right)\right) \]
          3. associate-/r*N/A

            \[\leadsto \mathsf{fabs.f64}\left(\mathsf{*.f64}\left(eh, \left(\frac{\frac{eh}{ew \cdot \tan t}}{\sqrt{1 + \frac{\frac{eh}{ew}}{\tan t} \cdot \frac{\frac{eh}{ew}}{\tan t}}}\right)\right)\right) \]
          4. metadata-evalN/A

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

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

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

            \[\leadsto \mathsf{fabs.f64}\left(\mathsf{*.f64}\left(eh, \mathsf{/.f64}\left(eh, \mathsf{*.f64}\left(\left(\sqrt{1 \cdot 1 + \frac{\frac{eh}{ew}}{\tan t} \cdot \frac{\frac{eh}{ew}}{\tan t}}\right), \left(ew \cdot \tan t\right)\right)\right)\right)\right) \]
        7. Applied egg-rr42.8%

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

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

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

          if 1.74999999999999992e-7 < t

          1. Initial program 99.6%

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

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

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

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

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

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

            \[\leadsto \left|\frac{1}{\color{blue}{\frac{1}{ew \cdot \sin t}}}\right| \]
        10. Recombined 3 regimes into one program.
        11. Final simplification62.7%

          \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -4.1 \cdot 10^{-41}:\\ \;\;\;\;\left|\sin t \cdot ew\right|\\ \mathbf{elif}\;t \leq 1.75 \cdot 10^{-7}:\\ \;\;\;\;\left|eh\right|\\ \mathbf{else}:\\ \;\;\;\;\left|\frac{1}{\frac{1}{\sin t \cdot ew}}\right|\\ \end{array} \]
        12. Add Preprocessing

        Alternative 8: 61.3% accurate, 4.3× speedup?

        \[\begin{array}{l} \\ \begin{array}{l} t_1 := \left|\sin t \cdot ew\right|\\ \mathbf{if}\;t \leq -1.35 \cdot 10^{-41}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t \leq 2.3 \cdot 10^{-7}:\\ \;\;\;\;\left|eh\right|\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
        (FPCore (eh ew t)
         :precision binary64
         (let* ((t_1 (fabs (* (sin t) ew))))
           (if (<= t -1.35e-41) t_1 (if (<= t 2.3e-7) (fabs eh) t_1))))
        double code(double eh, double ew, double t) {
        	double t_1 = fabs((sin(t) * ew));
        	double tmp;
        	if (t <= -1.35e-41) {
        		tmp = t_1;
        	} else if (t <= 2.3e-7) {
        		tmp = fabs(eh);
        	} 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((sin(t) * ew))
            if (t <= (-1.35d-41)) then
                tmp = t_1
            else if (t <= 2.3d-7) then
                tmp = abs(eh)
            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((Math.sin(t) * ew));
        	double tmp;
        	if (t <= -1.35e-41) {
        		tmp = t_1;
        	} else if (t <= 2.3e-7) {
        		tmp = Math.abs(eh);
        	} else {
        		tmp = t_1;
        	}
        	return tmp;
        }
        
        def code(eh, ew, t):
        	t_1 = math.fabs((math.sin(t) * ew))
        	tmp = 0
        	if t <= -1.35e-41:
        		tmp = t_1
        	elif t <= 2.3e-7:
        		tmp = math.fabs(eh)
        	else:
        		tmp = t_1
        	return tmp
        
        function code(eh, ew, t)
        	t_1 = abs(Float64(sin(t) * ew))
        	tmp = 0.0
        	if (t <= -1.35e-41)
        		tmp = t_1;
        	elseif (t <= 2.3e-7)
        		tmp = abs(eh);
        	else
        		tmp = t_1;
        	end
        	return tmp
        end
        
        function tmp_2 = code(eh, ew, t)
        	t_1 = abs((sin(t) * ew));
        	tmp = 0.0;
        	if (t <= -1.35e-41)
        		tmp = t_1;
        	elseif (t <= 2.3e-7)
        		tmp = abs(eh);
        	else
        		tmp = t_1;
        	end
        	tmp_2 = tmp;
        end
        
        code[eh_, ew_, t_] := Block[{t$95$1 = N[Abs[N[(N[Sin[t], $MachinePrecision] * ew), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t, -1.35e-41], t$95$1, If[LessEqual[t, 2.3e-7], N[Abs[eh], $MachinePrecision], t$95$1]]]
        
        \begin{array}{l}
        
        \\
        \begin{array}{l}
        t_1 := \left|\sin t \cdot ew\right|\\
        \mathbf{if}\;t \leq -1.35 \cdot 10^{-41}:\\
        \;\;\;\;t\_1\\
        
        \mathbf{elif}\;t \leq 2.3 \cdot 10^{-7}:\\
        \;\;\;\;\left|eh\right|\\
        
        \mathbf{else}:\\
        \;\;\;\;t\_1\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 2 regimes
        2. if t < -1.35e-41 or 2.29999999999999995e-7 < t

          1. Initial program 99.7%

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

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

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

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

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

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

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

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

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

              \[\leadsto \mathsf{fabs.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{sin.f64}\left(t\right), \mathsf{hypot.f64}\left(1, \mathsf{/.f64}\left(\mathsf{/.f64}\left(eh, ew\right), \tan t\right)\right)\right), ew\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(eh, \mathsf{cos.f64}\left(t\right)\right), \mathsf{sin.f64}\left(\mathsf{atan.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(eh, ew\right), \mathsf{tan.f64}\left(t\right)\right)\right)\right)\right)\right)\right) \]
            12. tan-lowering-tan.f6499.7%

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

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

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

              \[\leadsto \mathsf{fabs.f64}\left(\mathsf{*.f64}\left(ew, \sin t\right)\right) \]
            2. sin-lowering-sin.f6451.5%

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

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

          if -1.35e-41 < t < 2.29999999999999995e-7

          1. Initial program 100.0%

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

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

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

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

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

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

              \[\leadsto \mathsf{fabs.f64}\left(\mathsf{*.f64}\left(eh, \mathsf{sin.f64}\left(\mathsf{atan.f64}\left(\mathsf{/.f64}\left(eh, \mathsf{*.f64}\left(ew, \tan t\right)\right)\right)\right)\right)\right) \]
            6. tan-lowering-tan.f6474.5%

              \[\leadsto \mathsf{fabs.f64}\left(\mathsf{*.f64}\left(eh, \mathsf{sin.f64}\left(\mathsf{atan.f64}\left(\mathsf{/.f64}\left(eh, \mathsf{*.f64}\left(ew, \mathsf{tan.f64}\left(t\right)\right)\right)\right)\right)\right)\right) \]
          5. Simplified74.5%

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

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

              \[\leadsto \mathsf{fabs.f64}\left(\mathsf{*.f64}\left(eh, \left(\frac{\frac{\frac{eh}{ew}}{\tan t}}{\sqrt{1 + \frac{\frac{eh}{ew}}{\tan t} \cdot \frac{\frac{eh}{ew}}{\tan t}}}\right)\right)\right) \]
            3. associate-/r*N/A

              \[\leadsto \mathsf{fabs.f64}\left(\mathsf{*.f64}\left(eh, \left(\frac{\frac{eh}{ew \cdot \tan t}}{\sqrt{1 + \frac{\frac{eh}{ew}}{\tan t} \cdot \frac{\frac{eh}{ew}}{\tan t}}}\right)\right)\right) \]
            4. metadata-evalN/A

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

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

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

              \[\leadsto \mathsf{fabs.f64}\left(\mathsf{*.f64}\left(eh, \mathsf{/.f64}\left(eh, \mathsf{*.f64}\left(\left(\sqrt{1 \cdot 1 + \frac{\frac{eh}{ew}}{\tan t} \cdot \frac{\frac{eh}{ew}}{\tan t}}\right), \left(ew \cdot \tan t\right)\right)\right)\right)\right) \]
          7. Applied egg-rr42.8%

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

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

              \[\leadsto \left|\color{blue}{eh}\right| \]
          10. Recombined 2 regimes into one program.
          11. Final simplification62.7%

            \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -1.35 \cdot 10^{-41}:\\ \;\;\;\;\left|\sin t \cdot ew\right|\\ \mathbf{elif}\;t \leq 2.3 \cdot 10^{-7}:\\ \;\;\;\;\left|eh\right|\\ \mathbf{else}:\\ \;\;\;\;\left|\sin t \cdot ew\right|\\ \end{array} \]
          12. Add Preprocessing

          Alternative 9: 43.5% accurate, 8.5× speedup?

          \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;ew \leq 2.5 \cdot 10^{+99}:\\ \;\;\;\;\left|eh\right|\\ \mathbf{else}:\\ \;\;\;\;\left|t \cdot ew\right|\\ \end{array} \end{array} \]
          (FPCore (eh ew t)
           :precision binary64
           (if (<= ew 2.5e+99) (fabs eh) (fabs (* t ew))))
          double code(double eh, double ew, double t) {
          	double tmp;
          	if (ew <= 2.5e+99) {
          		tmp = fabs(eh);
          	} else {
          		tmp = fabs((t * 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.5d+99) then
                  tmp = abs(eh)
              else
                  tmp = abs((t * ew))
              end if
              code = tmp
          end function
          
          public static double code(double eh, double ew, double t) {
          	double tmp;
          	if (ew <= 2.5e+99) {
          		tmp = Math.abs(eh);
          	} else {
          		tmp = Math.abs((t * ew));
          	}
          	return tmp;
          }
          
          def code(eh, ew, t):
          	tmp = 0
          	if ew <= 2.5e+99:
          		tmp = math.fabs(eh)
          	else:
          		tmp = math.fabs((t * ew))
          	return tmp
          
          function code(eh, ew, t)
          	tmp = 0.0
          	if (ew <= 2.5e+99)
          		tmp = abs(eh);
          	else
          		tmp = abs(Float64(t * ew));
          	end
          	return tmp
          end
          
          function tmp_2 = code(eh, ew, t)
          	tmp = 0.0;
          	if (ew <= 2.5e+99)
          		tmp = abs(eh);
          	else
          		tmp = abs((t * ew));
          	end
          	tmp_2 = tmp;
          end
          
          code[eh_, ew_, t_] := If[LessEqual[ew, 2.5e+99], N[Abs[eh], $MachinePrecision], N[Abs[N[(t * ew), $MachinePrecision]], $MachinePrecision]]
          
          \begin{array}{l}
          
          \\
          \begin{array}{l}
          \mathbf{if}\;ew \leq 2.5 \cdot 10^{+99}:\\
          \;\;\;\;\left|eh\right|\\
          
          \mathbf{else}:\\
          \;\;\;\;\left|t \cdot ew\right|\\
          
          
          \end{array}
          \end{array}
          
          Derivation
          1. Split input into 2 regimes
          2. if ew < 2.50000000000000004e99

            1. Initial program 99.8%

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

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

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

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

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

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

                \[\leadsto \mathsf{fabs.f64}\left(\mathsf{*.f64}\left(eh, \mathsf{sin.f64}\left(\mathsf{atan.f64}\left(\mathsf{/.f64}\left(eh, \mathsf{*.f64}\left(ew, \tan t\right)\right)\right)\right)\right)\right) \]
              6. tan-lowering-tan.f6448.4%

                \[\leadsto \mathsf{fabs.f64}\left(\mathsf{*.f64}\left(eh, \mathsf{sin.f64}\left(\mathsf{atan.f64}\left(\mathsf{/.f64}\left(eh, \mathsf{*.f64}\left(ew, \mathsf{tan.f64}\left(t\right)\right)\right)\right)\right)\right)\right) \]
            5. Simplified48.4%

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

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

                \[\leadsto \mathsf{fabs.f64}\left(\mathsf{*.f64}\left(eh, \left(\frac{\frac{\frac{eh}{ew}}{\tan t}}{\sqrt{1 + \frac{\frac{eh}{ew}}{\tan t} \cdot \frac{\frac{eh}{ew}}{\tan t}}}\right)\right)\right) \]
              3. associate-/r*N/A

                \[\leadsto \mathsf{fabs.f64}\left(\mathsf{*.f64}\left(eh, \left(\frac{\frac{eh}{ew \cdot \tan t}}{\sqrt{1 + \frac{\frac{eh}{ew}}{\tan t} \cdot \frac{\frac{eh}{ew}}{\tan t}}}\right)\right)\right) \]
              4. metadata-evalN/A

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

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

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

                \[\leadsto \mathsf{fabs.f64}\left(\mathsf{*.f64}\left(eh, \mathsf{/.f64}\left(eh, \mathsf{*.f64}\left(\left(\sqrt{1 \cdot 1 + \frac{\frac{eh}{ew}}{\tan t} \cdot \frac{\frac{eh}{ew}}{\tan t}}\right), \left(ew \cdot \tan t\right)\right)\right)\right)\right) \]
            7. Applied egg-rr28.1%

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

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

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

              if 2.50000000000000004e99 < ew

              1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

                  \[\leadsto \mathsf{fabs.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{sin.f64}\left(t\right), \mathsf{hypot.f64}\left(1, \mathsf{/.f64}\left(\mathsf{/.f64}\left(eh, ew\right), \tan t\right)\right)\right), ew\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(eh, \mathsf{cos.f64}\left(t\right)\right), \mathsf{sin.f64}\left(\mathsf{atan.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(eh, ew\right), \mathsf{tan.f64}\left(t\right)\right)\right)\right)\right)\right)\right) \]
                12. tan-lowering-tan.f6499.8%

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

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

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

                  \[\leadsto \mathsf{fabs.f64}\left(\mathsf{*.f64}\left(ew, \sin t\right)\right) \]
                2. sin-lowering-sin.f6481.5%

                  \[\leadsto \mathsf{fabs.f64}\left(\mathsf{*.f64}\left(ew, \mathsf{sin.f64}\left(t\right)\right)\right) \]
              7. Simplified81.5%

                \[\leadsto \left|\color{blue}{ew \cdot \sin t}\right| \]
              8. Taylor expanded in t around 0

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

                  \[\leadsto \mathsf{fabs.f64}\left(\left(t \cdot ew\right)\right) \]
                2. *-lowering-*.f6439.7%

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

                \[\leadsto \left|\color{blue}{t \cdot ew}\right| \]
            10. Recombined 2 regimes into one program.
            11. Add Preprocessing

            Alternative 10: 42.3% accurate, 9.1× speedup?

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

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

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

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

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

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

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

                \[\leadsto \mathsf{fabs.f64}\left(\mathsf{*.f64}\left(eh, \mathsf{sin.f64}\left(\mathsf{atan.f64}\left(\mathsf{/.f64}\left(eh, \mathsf{*.f64}\left(ew, \tan t\right)\right)\right)\right)\right)\right) \]
              6. tan-lowering-tan.f6443.5%

                \[\leadsto \mathsf{fabs.f64}\left(\mathsf{*.f64}\left(eh, \mathsf{sin.f64}\left(\mathsf{atan.f64}\left(\mathsf{/.f64}\left(eh, \mathsf{*.f64}\left(ew, \mathsf{tan.f64}\left(t\right)\right)\right)\right)\right)\right)\right) \]
            5. Simplified43.5%

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

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

                \[\leadsto \mathsf{fabs.f64}\left(\mathsf{*.f64}\left(eh, \left(\frac{\frac{\frac{eh}{ew}}{\tan t}}{\sqrt{1 + \frac{\frac{eh}{ew}}{\tan t} \cdot \frac{\frac{eh}{ew}}{\tan t}}}\right)\right)\right) \]
              3. associate-/r*N/A

                \[\leadsto \mathsf{fabs.f64}\left(\mathsf{*.f64}\left(eh, \left(\frac{\frac{eh}{ew \cdot \tan t}}{\sqrt{1 + \frac{\frac{eh}{ew}}{\tan t} \cdot \frac{\frac{eh}{ew}}{\tan t}}}\right)\right)\right) \]
              4. metadata-evalN/A

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

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

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

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

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

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

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

              Reproduce

              ?
              herbie shell --seed 2024158 
              (FPCore (eh ew t)
                :name "Example from Robby"
                :precision binary64
                (fabs (+ (* (* ew (sin t)) (cos (atan (/ (/ eh ew) (tan t))))) (* (* eh (cos t)) (sin (atan (/ (/ eh ew) (tan t))))))))