Example 2 from Robby

Percentage Accurate: 99.8% → 99.8%
Time: 18.7s
Alternatives: 8
Speedup: N/A×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 8 alternatives:

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

Initial Program: 99.8% accurate, 1.0× speedup?

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

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

Alternative 1: 99.8% accurate, 1.0× speedup?

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

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

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

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

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

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

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

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

Alternative 2: 98.6% accurate, 1.5× speedup?

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

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

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

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

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

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

      \[\leadsto \left|-1 \cdot \left(eh \cdot \sin t\right) + \color{blue}{\left(\mathsf{neg}\left(ew \cdot \left(\cos t \cdot \cos \tan^{-1} \left(\frac{eh \cdot \tan t}{ew}\right)\right)\right)\right)}\right| \]
    2. unsub-negN/A

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

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

      \[\leadsto \left|\color{blue}{\left(\mathsf{neg}\left(eh \cdot \sin t\right)\right)} - ew \cdot \left(\cos t \cdot \cos \tan^{-1} \left(\frac{eh \cdot \tan t}{ew}\right)\right)\right| \]
    5. neg-sub0N/A

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \color{blue}{\left|\mathsf{neg}\left(\left(eh \cdot \sin t + ew \cdot \left(\cos t \cdot \cos \tan^{-1} \left(\frac{eh \cdot \tan t}{ew}\right)\right)\right)\right)\right|} \]
  9. Step-by-step derivation
    1. fabs-negN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 74.0% accurate, 1.8× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if eh < -1.45000000000000003e162 or 6.5000000000000001e72 < eh

    1. Initial program 99.8%

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

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

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

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

        \[\leadsto \left|\color{blue}{eh \cdot \sin t}\right| \]
      2. sin-lowering-sin.f6476.6

        \[\leadsto \left|eh \cdot \color{blue}{\sin t}\right| \]
    7. Simplified76.6%

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

    if -1.45000000000000003e162 < eh < 6.5000000000000001e72

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

        \[\leadsto \left|\left(ew \cdot \cos t\right) \cdot \color{blue}{\cos \tan^{-1} \left(\frac{eh \cdot \tan t}{ew}\right)}\right| \]
      6. atan-lowering-atan.f64N/A

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

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

        \[\leadsto \left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\color{blue}{eh \cdot \tan t}}{ew}\right)\right| \]
      9. tan-lowering-tan.f6477.0

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

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

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

Alternative 4: 75.4% accurate, 2.2× speedup?

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

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

\mathbf{elif}\;t \leq 1480:\\
\;\;\;\;\left|eh \cdot t + ew \cdot \cos \tan^{-1} \left(eh \cdot \frac{\tan t}{ew}\right)\right|\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -6.6e-4 or 1480 < t

    1. Initial program 99.7%

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

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

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

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

        \[\leadsto \left|\color{blue}{eh \cdot \sin t}\right| \]
      2. sin-lowering-sin.f6449.5

        \[\leadsto \left|eh \cdot \color{blue}{\sin t}\right| \]
    7. Simplified49.5%

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

    if -6.6e-4 < t < 1480

    1. Initial program 100.0%

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

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

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

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

        \[\leadsto \left|-1 \cdot \left(eh \cdot \sin t\right) + \color{blue}{\left(\mathsf{neg}\left(ew \cdot \left(\cos t \cdot \cos \tan^{-1} \left(\frac{eh \cdot \tan t}{ew}\right)\right)\right)\right)}\right| \]
      2. unsub-negN/A

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

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

        \[\leadsto \left|\color{blue}{\left(\mathsf{neg}\left(eh \cdot \sin t\right)\right)} - ew \cdot \left(\cos t \cdot \cos \tan^{-1} \left(\frac{eh \cdot \tan t}{ew}\right)\right)\right| \]
      5. neg-sub0N/A

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \left|\color{blue}{-1 \cdot \left(eh \cdot t\right) - ew \cdot \cos \tan^{-1} \left(\frac{eh \cdot \tan t}{ew}\right)}\right| \]
    9. Step-by-step derivation
      1. --lowering--.f64N/A

        \[\leadsto \left|\color{blue}{-1 \cdot \left(eh \cdot t\right) - ew \cdot \cos \tan^{-1} \left(\frac{eh \cdot \tan t}{ew}\right)}\right| \]
      2. mul-1-negN/A

        \[\leadsto \left|\color{blue}{\left(\mathsf{neg}\left(eh \cdot t\right)\right)} - ew \cdot \cos \tan^{-1} \left(\frac{eh \cdot \tan t}{ew}\right)\right| \]
      3. neg-sub0N/A

        \[\leadsto \left|\color{blue}{\left(0 - eh \cdot t\right)} - ew \cdot \cos \tan^{-1} \left(\frac{eh \cdot \tan t}{ew}\right)\right| \]
      4. --lowering--.f64N/A

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

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

        \[\leadsto \left|\left(0 - eh \cdot t\right) - \color{blue}{ew \cdot \cos \tan^{-1} \left(\frac{eh \cdot \tan t}{ew}\right)}\right| \]
      7. cos-lowering-cos.f64N/A

        \[\leadsto \left|\left(0 - eh \cdot t\right) - ew \cdot \color{blue}{\cos \tan^{-1} \left(\frac{eh \cdot \tan t}{ew}\right)}\right| \]
      8. atan-lowering-atan.f64N/A

        \[\leadsto \left|\left(0 - eh \cdot t\right) - ew \cdot \cos \color{blue}{\tan^{-1} \left(\frac{eh \cdot \tan t}{ew}\right)}\right| \]
      9. associate-/l*N/A

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

        \[\leadsto \left|\left(0 - eh \cdot t\right) - ew \cdot \cos \tan^{-1} \color{blue}{\left(eh \cdot \frac{\tan t}{ew}\right)}\right| \]
      11. /-lowering-/.f64N/A

        \[\leadsto \left|\left(0 - eh \cdot t\right) - ew \cdot \cos \tan^{-1} \left(eh \cdot \color{blue}{\frac{\tan t}{ew}}\right)\right| \]
      12. tan-lowering-tan.f6498.0

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

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

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

Alternative 5: 62.4% accurate, 4.3× speedup?

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

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

\mathbf{elif}\;t \leq 6.8 \cdot 10^{-50}:\\
\;\;\;\;\left|ew\right|\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -8.0000000000000005e-9 or 6.80000000000000029e-50 < t

    1. Initial program 99.7%

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

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

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

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

        \[\leadsto \left|\color{blue}{eh \cdot \sin t}\right| \]
      2. sin-lowering-sin.f6450.4

        \[\leadsto \left|eh \cdot \color{blue}{\sin t}\right| \]
    7. Simplified50.4%

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

    if -8.0000000000000005e-9 < t < 6.80000000000000029e-50

    1. Initial program 100.0%

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

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

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

        \[\leadsto \left|ew \cdot \color{blue}{\cos \tan^{-1} \left(-1 \cdot \frac{eh \cdot \tan t}{ew}\right)}\right| \]
      3. atan-lowering-atan.f64N/A

        \[\leadsto \left|ew \cdot \cos \color{blue}{\tan^{-1} \left(-1 \cdot \frac{eh \cdot \tan t}{ew}\right)}\right| \]
      4. mul-1-negN/A

        \[\leadsto \left|ew \cdot \cos \tan^{-1} \color{blue}{\left(\mathsf{neg}\left(\frac{eh \cdot \tan t}{ew}\right)\right)}\right| \]
      5. distribute-neg-frac2N/A

        \[\leadsto \left|ew \cdot \cos \tan^{-1} \color{blue}{\left(\frac{eh \cdot \tan t}{\mathsf{neg}\left(ew\right)}\right)}\right| \]
      6. mul-1-negN/A

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

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

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

        \[\leadsto \left|ew \cdot \cos \tan^{-1} \left(\frac{eh \cdot \color{blue}{\tan t}}{-1 \cdot ew}\right)\right| \]
      10. mul-1-negN/A

        \[\leadsto \left|ew \cdot \cos \tan^{-1} \left(\frac{eh \cdot \tan t}{\color{blue}{\mathsf{neg}\left(ew\right)}}\right)\right| \]
      11. neg-sub0N/A

        \[\leadsto \left|ew \cdot \cos \tan^{-1} \left(\frac{eh \cdot \tan t}{\color{blue}{0 - ew}}\right)\right| \]
      12. --lowering--.f6472.9

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

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

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

        \[\leadsto \left|ew \cdot \cos \tan^{-1} \color{blue}{\left(\frac{eh \cdot \tan t}{{0}^{3} - {ew}^{3}} \cdot \left(0 \cdot 0 + \left(ew \cdot ew + 0 \cdot ew\right)\right)\right)}\right| \]
      3. metadata-evalN/A

        \[\leadsto \left|ew \cdot \cos \tan^{-1} \left(\frac{eh \cdot \tan t}{{0}^{3} - {ew}^{3}} \cdot \left(\color{blue}{0} + \left(ew \cdot ew + 0 \cdot ew\right)\right)\right)\right| \]
      4. +-lft-identityN/A

        \[\leadsto \left|ew \cdot \cos \tan^{-1} \left(\frac{eh \cdot \tan t}{{0}^{3} - {ew}^{3}} \cdot \color{blue}{\left(ew \cdot ew + 0 \cdot ew\right)}\right)\right| \]
      5. distribute-rgt-outN/A

        \[\leadsto \left|ew \cdot \cos \tan^{-1} \left(\frac{eh \cdot \tan t}{{0}^{3} - {ew}^{3}} \cdot \color{blue}{\left(ew \cdot \left(ew + 0\right)\right)}\right)\right| \]
      6. +-commutativeN/A

        \[\leadsto \left|ew \cdot \cos \tan^{-1} \left(\frac{eh \cdot \tan t}{{0}^{3} - {ew}^{3}} \cdot \left(ew \cdot \color{blue}{\left(0 + ew\right)}\right)\right)\right| \]
      7. +-lft-identityN/A

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

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

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

        \[\leadsto \left|ew \cdot \cos \tan^{-1} \left(\frac{\color{blue}{eh \cdot \tan t}}{{0}^{3} - {ew}^{3}} \cdot \left(ew \cdot ew\right)\right)\right| \]
      11. tan-lowering-tan.f64N/A

        \[\leadsto \left|ew \cdot \cos \tan^{-1} \left(\frac{eh \cdot \color{blue}{\tan t}}{{0}^{3} - {ew}^{3}} \cdot \left(ew \cdot ew\right)\right)\right| \]
      12. metadata-evalN/A

        \[\leadsto \left|ew \cdot \cos \tan^{-1} \left(\frac{eh \cdot \tan t}{\color{blue}{0} - {ew}^{3}} \cdot \left(ew \cdot ew\right)\right)\right| \]
      13. --lowering--.f64N/A

        \[\leadsto \left|ew \cdot \cos \tan^{-1} \left(\frac{eh \cdot \tan t}{\color{blue}{0 - {ew}^{3}}} \cdot \left(ew \cdot ew\right)\right)\right| \]
      14. cube-multN/A

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

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

        \[\leadsto \left|ew \cdot \cos \tan^{-1} \left(\frac{eh \cdot \tan t}{0 - ew \cdot \color{blue}{\left(ew \cdot ew\right)}} \cdot \left(ew \cdot ew\right)\right)\right| \]
      17. *-lowering-*.f6425.2

        \[\leadsto \left|ew \cdot \cos \tan^{-1} \left(\frac{eh \cdot \tan t}{0 - ew \cdot \left(ew \cdot ew\right)} \cdot \color{blue}{\left(ew \cdot ew\right)}\right)\right| \]
    7. Applied egg-rr25.2%

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

      \[\leadsto \left|ew \cdot \color{blue}{{\left(1 + {\left(\frac{\frac{ew}{\tan t}}{eh}\right)}^{-2}\right)}^{-0.5}}\right| \]
    9. Taylor expanded in ew around inf

      \[\leadsto \left|\color{blue}{ew}\right| \]
    10. Step-by-step derivation
      1. Simplified73.1%

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

    Alternative 6: 46.1% accurate, 8.1× speedup?

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

      1. Initial program 99.8%

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

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

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

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

          \[\leadsto \left|\color{blue}{eh \cdot \sin t}\right| \]
        2. sin-lowering-sin.f6479.8

          \[\leadsto \left|eh \cdot \color{blue}{\sin t}\right| \]
      7. Simplified79.8%

        \[\leadsto \left|\color{blue}{eh \cdot \sin t}\right| \]
      8. Step-by-step derivation
        1. neg-fabsN/A

          \[\leadsto \color{blue}{\left|\mathsf{neg}\left(eh \cdot \sin t\right)\right|} \]
        2. sub0-negN/A

          \[\leadsto \left|\color{blue}{0 - eh \cdot \sin t}\right| \]
        3. flip3--N/A

          \[\leadsto \left|\color{blue}{\frac{{0}^{3} - {\left(eh \cdot \sin t\right)}^{3}}{0 \cdot 0 + \left(\left(eh \cdot \sin t\right) \cdot \left(eh \cdot \sin t\right) + 0 \cdot \left(eh \cdot \sin t\right)\right)}}\right| \]
        4. fabs-divN/A

          \[\leadsto \color{blue}{\frac{\left|{0}^{3} - {\left(eh \cdot \sin t\right)}^{3}\right|}{\left|0 \cdot 0 + \left(\left(eh \cdot \sin t\right) \cdot \left(eh \cdot \sin t\right) + 0 \cdot \left(eh \cdot \sin t\right)\right)\right|}} \]
      9. Applied egg-rr50.9%

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

      if -1.05e163 < eh < 2.4999999999999998e162

      1. Initial program 99.9%

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

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

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

          \[\leadsto \left|ew \cdot \color{blue}{\cos \tan^{-1} \left(-1 \cdot \frac{eh \cdot \tan t}{ew}\right)}\right| \]
        3. atan-lowering-atan.f64N/A

          \[\leadsto \left|ew \cdot \cos \color{blue}{\tan^{-1} \left(-1 \cdot \frac{eh \cdot \tan t}{ew}\right)}\right| \]
        4. mul-1-negN/A

          \[\leadsto \left|ew \cdot \cos \tan^{-1} \color{blue}{\left(\mathsf{neg}\left(\frac{eh \cdot \tan t}{ew}\right)\right)}\right| \]
        5. distribute-neg-frac2N/A

          \[\leadsto \left|ew \cdot \cos \tan^{-1} \color{blue}{\left(\frac{eh \cdot \tan t}{\mathsf{neg}\left(ew\right)}\right)}\right| \]
        6. mul-1-negN/A

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

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

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

          \[\leadsto \left|ew \cdot \cos \tan^{-1} \left(\frac{eh \cdot \color{blue}{\tan t}}{-1 \cdot ew}\right)\right| \]
        10. mul-1-negN/A

          \[\leadsto \left|ew \cdot \cos \tan^{-1} \left(\frac{eh \cdot \tan t}{\color{blue}{\mathsf{neg}\left(ew\right)}}\right)\right| \]
        11. neg-sub0N/A

          \[\leadsto \left|ew \cdot \cos \tan^{-1} \left(\frac{eh \cdot \tan t}{\color{blue}{0 - ew}}\right)\right| \]
        12. --lowering--.f6449.9

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

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

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

          \[\leadsto \left|ew \cdot \cos \tan^{-1} \color{blue}{\left(\frac{eh \cdot \tan t}{{0}^{3} - {ew}^{3}} \cdot \left(0 \cdot 0 + \left(ew \cdot ew + 0 \cdot ew\right)\right)\right)}\right| \]
        3. metadata-evalN/A

          \[\leadsto \left|ew \cdot \cos \tan^{-1} \left(\frac{eh \cdot \tan t}{{0}^{3} - {ew}^{3}} \cdot \left(\color{blue}{0} + \left(ew \cdot ew + 0 \cdot ew\right)\right)\right)\right| \]
        4. +-lft-identityN/A

          \[\leadsto \left|ew \cdot \cos \tan^{-1} \left(\frac{eh \cdot \tan t}{{0}^{3} - {ew}^{3}} \cdot \color{blue}{\left(ew \cdot ew + 0 \cdot ew\right)}\right)\right| \]
        5. distribute-rgt-outN/A

          \[\leadsto \left|ew \cdot \cos \tan^{-1} \left(\frac{eh \cdot \tan t}{{0}^{3} - {ew}^{3}} \cdot \color{blue}{\left(ew \cdot \left(ew + 0\right)\right)}\right)\right| \]
        6. +-commutativeN/A

          \[\leadsto \left|ew \cdot \cos \tan^{-1} \left(\frac{eh \cdot \tan t}{{0}^{3} - {ew}^{3}} \cdot \left(ew \cdot \color{blue}{\left(0 + ew\right)}\right)\right)\right| \]
        7. +-lft-identityN/A

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

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

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

          \[\leadsto \left|ew \cdot \cos \tan^{-1} \left(\frac{\color{blue}{eh \cdot \tan t}}{{0}^{3} - {ew}^{3}} \cdot \left(ew \cdot ew\right)\right)\right| \]
        11. tan-lowering-tan.f64N/A

          \[\leadsto \left|ew \cdot \cos \tan^{-1} \left(\frac{eh \cdot \color{blue}{\tan t}}{{0}^{3} - {ew}^{3}} \cdot \left(ew \cdot ew\right)\right)\right| \]
        12. metadata-evalN/A

          \[\leadsto \left|ew \cdot \cos \tan^{-1} \left(\frac{eh \cdot \tan t}{\color{blue}{0} - {ew}^{3}} \cdot \left(ew \cdot ew\right)\right)\right| \]
        13. --lowering--.f64N/A

          \[\leadsto \left|ew \cdot \cos \tan^{-1} \left(\frac{eh \cdot \tan t}{\color{blue}{0 - {ew}^{3}}} \cdot \left(ew \cdot ew\right)\right)\right| \]
        14. cube-multN/A

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

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

          \[\leadsto \left|ew \cdot \cos \tan^{-1} \left(\frac{eh \cdot \tan t}{0 - ew \cdot \color{blue}{\left(ew \cdot ew\right)}} \cdot \left(ew \cdot ew\right)\right)\right| \]
        17. *-lowering-*.f6419.7

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

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

        \[\leadsto \left|ew \cdot \color{blue}{{\left(1 + {\left(\frac{\frac{ew}{\tan t}}{eh}\right)}^{-2}\right)}^{-0.5}}\right| \]
      9. Taylor expanded in ew around inf

        \[\leadsto \left|\color{blue}{ew}\right| \]
      10. Step-by-step derivation
        1. Simplified50.0%

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

        if 2.4999999999999998e162 < eh

        1. Initial program 99.8%

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

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

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

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

            \[\leadsto \left|\color{blue}{eh \cdot \sin t}\right| \]
          2. sin-lowering-sin.f6483.6

            \[\leadsto \left|eh \cdot \color{blue}{\sin t}\right| \]
        7. Simplified83.6%

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

          \[\leadsto \left|\color{blue}{eh \cdot t}\right| \]
        9. Step-by-step derivation
          1. *-lowering-*.f6458.0

            \[\leadsto \left|\color{blue}{eh \cdot t}\right| \]
        10. Simplified58.0%

          \[\leadsto \left|\color{blue}{eh \cdot t}\right| \]
      11. Recombined 3 regimes into one program.
      12. Final simplification51.1%

        \[\leadsto \begin{array}{l} \mathbf{if}\;eh \leq -1.05 \cdot 10^{+163}:\\ \;\;\;\;eh \cdot \sin t\\ \mathbf{elif}\;eh \leq 2.5 \cdot 10^{+162}:\\ \;\;\;\;\left|ew\right|\\ \mathbf{else}:\\ \;\;\;\;\left|eh \cdot t\right|\\ \end{array} \]
      13. Add Preprocessing

      Alternative 7: 44.3% accurate, 8.5× speedup?

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

        1. Initial program 99.8%

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

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

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

            \[\leadsto \left|ew \cdot \color{blue}{\cos \tan^{-1} \left(-1 \cdot \frac{eh \cdot \tan t}{ew}\right)}\right| \]
          3. atan-lowering-atan.f64N/A

            \[\leadsto \left|ew \cdot \cos \color{blue}{\tan^{-1} \left(-1 \cdot \frac{eh \cdot \tan t}{ew}\right)}\right| \]
          4. mul-1-negN/A

            \[\leadsto \left|ew \cdot \cos \tan^{-1} \color{blue}{\left(\mathsf{neg}\left(\frac{eh \cdot \tan t}{ew}\right)\right)}\right| \]
          5. distribute-neg-frac2N/A

            \[\leadsto \left|ew \cdot \cos \tan^{-1} \color{blue}{\left(\frac{eh \cdot \tan t}{\mathsf{neg}\left(ew\right)}\right)}\right| \]
          6. mul-1-negN/A

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

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

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

            \[\leadsto \left|ew \cdot \cos \tan^{-1} \left(\frac{eh \cdot \color{blue}{\tan t}}{-1 \cdot ew}\right)\right| \]
          10. mul-1-negN/A

            \[\leadsto \left|ew \cdot \cos \tan^{-1} \left(\frac{eh \cdot \tan t}{\color{blue}{\mathsf{neg}\left(ew\right)}}\right)\right| \]
          11. neg-sub0N/A

            \[\leadsto \left|ew \cdot \cos \tan^{-1} \left(\frac{eh \cdot \tan t}{\color{blue}{0 - ew}}\right)\right| \]
          12. --lowering--.f6446.3

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

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

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

            \[\leadsto \left|ew \cdot \cos \tan^{-1} \color{blue}{\left(\frac{eh \cdot \tan t}{{0}^{3} - {ew}^{3}} \cdot \left(0 \cdot 0 + \left(ew \cdot ew + 0 \cdot ew\right)\right)\right)}\right| \]
          3. metadata-evalN/A

            \[\leadsto \left|ew \cdot \cos \tan^{-1} \left(\frac{eh \cdot \tan t}{{0}^{3} - {ew}^{3}} \cdot \left(\color{blue}{0} + \left(ew \cdot ew + 0 \cdot ew\right)\right)\right)\right| \]
          4. +-lft-identityN/A

            \[\leadsto \left|ew \cdot \cos \tan^{-1} \left(\frac{eh \cdot \tan t}{{0}^{3} - {ew}^{3}} \cdot \color{blue}{\left(ew \cdot ew + 0 \cdot ew\right)}\right)\right| \]
          5. distribute-rgt-outN/A

            \[\leadsto \left|ew \cdot \cos \tan^{-1} \left(\frac{eh \cdot \tan t}{{0}^{3} - {ew}^{3}} \cdot \color{blue}{\left(ew \cdot \left(ew + 0\right)\right)}\right)\right| \]
          6. +-commutativeN/A

            \[\leadsto \left|ew \cdot \cos \tan^{-1} \left(\frac{eh \cdot \tan t}{{0}^{3} - {ew}^{3}} \cdot \left(ew \cdot \color{blue}{\left(0 + ew\right)}\right)\right)\right| \]
          7. +-lft-identityN/A

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

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

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

            \[\leadsto \left|ew \cdot \cos \tan^{-1} \left(\frac{\color{blue}{eh \cdot \tan t}}{{0}^{3} - {ew}^{3}} \cdot \left(ew \cdot ew\right)\right)\right| \]
          11. tan-lowering-tan.f64N/A

            \[\leadsto \left|ew \cdot \cos \tan^{-1} \left(\frac{eh \cdot \color{blue}{\tan t}}{{0}^{3} - {ew}^{3}} \cdot \left(ew \cdot ew\right)\right)\right| \]
          12. metadata-evalN/A

            \[\leadsto \left|ew \cdot \cos \tan^{-1} \left(\frac{eh \cdot \tan t}{\color{blue}{0} - {ew}^{3}} \cdot \left(ew \cdot ew\right)\right)\right| \]
          13. --lowering--.f64N/A

            \[\leadsto \left|ew \cdot \cos \tan^{-1} \left(\frac{eh \cdot \tan t}{\color{blue}{0 - {ew}^{3}}} \cdot \left(ew \cdot ew\right)\right)\right| \]
          14. cube-multN/A

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

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

            \[\leadsto \left|ew \cdot \cos \tan^{-1} \left(\frac{eh \cdot \tan t}{0 - ew \cdot \color{blue}{\left(ew \cdot ew\right)}} \cdot \left(ew \cdot ew\right)\right)\right| \]
          17. *-lowering-*.f6418.0

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

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

          \[\leadsto \left|ew \cdot \color{blue}{{\left(1 + {\left(\frac{\frac{ew}{\tan t}}{eh}\right)}^{-2}\right)}^{-0.5}}\right| \]
        9. Taylor expanded in ew around inf

          \[\leadsto \left|\color{blue}{ew}\right| \]
        10. Step-by-step derivation
          1. Simplified46.5%

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

          if 1.3499999999999999e161 < eh

          1. Initial program 99.8%

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

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

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

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

              \[\leadsto \left|\color{blue}{eh \cdot \sin t}\right| \]
            2. sin-lowering-sin.f6483.6

              \[\leadsto \left|eh \cdot \color{blue}{\sin t}\right| \]
          7. Simplified83.6%

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

            \[\leadsto \left|\color{blue}{eh \cdot t}\right| \]
          9. Step-by-step derivation
            1. *-lowering-*.f6458.0

              \[\leadsto \left|\color{blue}{eh \cdot t}\right| \]
          10. Simplified58.0%

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

        Alternative 8: 43.0% accurate, 9.1× speedup?

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

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

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

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

            \[\leadsto \left|ew \cdot \color{blue}{\cos \tan^{-1} \left(-1 \cdot \frac{eh \cdot \tan t}{ew}\right)}\right| \]
          3. atan-lowering-atan.f64N/A

            \[\leadsto \left|ew \cdot \cos \color{blue}{\tan^{-1} \left(-1 \cdot \frac{eh \cdot \tan t}{ew}\right)}\right| \]
          4. mul-1-negN/A

            \[\leadsto \left|ew \cdot \cos \tan^{-1} \color{blue}{\left(\mathsf{neg}\left(\frac{eh \cdot \tan t}{ew}\right)\right)}\right| \]
          5. distribute-neg-frac2N/A

            \[\leadsto \left|ew \cdot \cos \tan^{-1} \color{blue}{\left(\frac{eh \cdot \tan t}{\mathsf{neg}\left(ew\right)}\right)}\right| \]
          6. mul-1-negN/A

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

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

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

            \[\leadsto \left|ew \cdot \cos \tan^{-1} \left(\frac{eh \cdot \color{blue}{\tan t}}{-1 \cdot ew}\right)\right| \]
          10. mul-1-negN/A

            \[\leadsto \left|ew \cdot \cos \tan^{-1} \left(\frac{eh \cdot \tan t}{\color{blue}{\mathsf{neg}\left(ew\right)}}\right)\right| \]
          11. neg-sub0N/A

            \[\leadsto \left|ew \cdot \cos \tan^{-1} \left(\frac{eh \cdot \tan t}{\color{blue}{0 - ew}}\right)\right| \]
          12. --lowering--.f6442.3

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

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

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

            \[\leadsto \left|ew \cdot \cos \tan^{-1} \color{blue}{\left(\frac{eh \cdot \tan t}{{0}^{3} - {ew}^{3}} \cdot \left(0 \cdot 0 + \left(ew \cdot ew + 0 \cdot ew\right)\right)\right)}\right| \]
          3. metadata-evalN/A

            \[\leadsto \left|ew \cdot \cos \tan^{-1} \left(\frac{eh \cdot \tan t}{{0}^{3} - {ew}^{3}} \cdot \left(\color{blue}{0} + \left(ew \cdot ew + 0 \cdot ew\right)\right)\right)\right| \]
          4. +-lft-identityN/A

            \[\leadsto \left|ew \cdot \cos \tan^{-1} \left(\frac{eh \cdot \tan t}{{0}^{3} - {ew}^{3}} \cdot \color{blue}{\left(ew \cdot ew + 0 \cdot ew\right)}\right)\right| \]
          5. distribute-rgt-outN/A

            \[\leadsto \left|ew \cdot \cos \tan^{-1} \left(\frac{eh \cdot \tan t}{{0}^{3} - {ew}^{3}} \cdot \color{blue}{\left(ew \cdot \left(ew + 0\right)\right)}\right)\right| \]
          6. +-commutativeN/A

            \[\leadsto \left|ew \cdot \cos \tan^{-1} \left(\frac{eh \cdot \tan t}{{0}^{3} - {ew}^{3}} \cdot \left(ew \cdot \color{blue}{\left(0 + ew\right)}\right)\right)\right| \]
          7. +-lft-identityN/A

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

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

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

            \[\leadsto \left|ew \cdot \cos \tan^{-1} \left(\frac{\color{blue}{eh \cdot \tan t}}{{0}^{3} - {ew}^{3}} \cdot \left(ew \cdot ew\right)\right)\right| \]
          11. tan-lowering-tan.f64N/A

            \[\leadsto \left|ew \cdot \cos \tan^{-1} \left(\frac{eh \cdot \color{blue}{\tan t}}{{0}^{3} - {ew}^{3}} \cdot \left(ew \cdot ew\right)\right)\right| \]
          12. metadata-evalN/A

            \[\leadsto \left|ew \cdot \cos \tan^{-1} \left(\frac{eh \cdot \tan t}{\color{blue}{0} - {ew}^{3}} \cdot \left(ew \cdot ew\right)\right)\right| \]
          13. --lowering--.f64N/A

            \[\leadsto \left|ew \cdot \cos \tan^{-1} \left(\frac{eh \cdot \tan t}{\color{blue}{0 - {ew}^{3}}} \cdot \left(ew \cdot ew\right)\right)\right| \]
          14. cube-multN/A

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

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

            \[\leadsto \left|ew \cdot \cos \tan^{-1} \left(\frac{eh \cdot \tan t}{0 - ew \cdot \color{blue}{\left(ew \cdot ew\right)}} \cdot \left(ew \cdot ew\right)\right)\right| \]
          17. *-lowering-*.f6416.1

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

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

          \[\leadsto \left|ew \cdot \color{blue}{{\left(1 + {\left(\frac{\frac{ew}{\tan t}}{eh}\right)}^{-2}\right)}^{-0.5}}\right| \]
        9. Taylor expanded in ew around inf

          \[\leadsto \left|\color{blue}{ew}\right| \]
        10. Step-by-step derivation
          1. Simplified42.5%

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

          Reproduce

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