Example 2 from Robby

Percentage Accurate: 99.8% → 99.8%
Time: 17.5s
Alternatives: 12
Speedup: 1.0×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 12 alternatives:

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

Initial Program: 99.8% accurate, 1.0× speedup?

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

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

Alternative 1: 99.8% accurate, 1.0× speedup?

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

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

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

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

Alternative 2: 99.8% accurate, 1.1× speedup?

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

\\
\begin{array}{l}
t_1 := \tan t \cdot eh\\
\left|\left(\sin t \cdot eh\right) \cdot \sin \tan^{-1} \left(\frac{t\_1}{-ew}\right) - \frac{\cos t}{\sqrt{{\left(\frac{t\_1}{ew}\right)}^{2} + 1}} \cdot ew\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. lift-*.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| \]
    2. lift-*.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| \]
    3. associate-*l*N/A

      \[\leadsto \left|\color{blue}{ew \cdot \left(\cos t \cdot \cos \tan^{-1} \left(\frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t}{ew}\right)\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. *-commutativeN/A

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

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

    \[\leadsto \left|\color{blue}{\frac{\cos t}{\sqrt{{\left(\frac{-ew}{\tan t \cdot eh}\right)}^{-2} + 1}} \cdot ew} - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right| \]
  5. Step-by-step derivation
    1. Applied rewrites99.8%

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

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

    Alternative 3: 98.9% accurate, 1.1× speedup?

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

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

      \[\leadsto \left|\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} \color{blue}{\left(-1 \cdot \frac{eh \cdot t}{ew}\right)}\right| \]
    4. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \left|\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} \color{blue}{\left(\frac{eh \cdot t}{ew} \cdot -1\right)}\right| \]
      2. associate-/l*N/A

        \[\leadsto \left|\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(\color{blue}{\left(eh \cdot \frac{t}{ew}\right)} \cdot -1\right)\right| \]
      3. associate-*l*N/A

        \[\leadsto \left|\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} \color{blue}{\left(eh \cdot \left(\frac{t}{ew} \cdot -1\right)\right)}\right| \]
      4. *-commutativeN/A

        \[\leadsto \left|\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} \color{blue}{\left(\left(\frac{t}{ew} \cdot -1\right) \cdot eh\right)}\right| \]
      5. lower-*.f64N/A

        \[\leadsto \left|\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} \color{blue}{\left(\left(\frac{t}{ew} \cdot -1\right) \cdot eh\right)}\right| \]
      6. associate-*l/N/A

        \[\leadsto \left|\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(\color{blue}{\frac{t \cdot -1}{ew}} \cdot eh\right)\right| \]
      7. *-commutativeN/A

        \[\leadsto \left|\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{\color{blue}{-1 \cdot t}}{ew} \cdot eh\right)\right| \]
      8. lower-/.f64N/A

        \[\leadsto \left|\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(\color{blue}{\frac{-1 \cdot t}{ew}} \cdot eh\right)\right| \]
      9. mul-1-negN/A

        \[\leadsto \left|\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{\color{blue}{\mathsf{neg}\left(t\right)}}{ew} \cdot eh\right)\right| \]
      10. lower-neg.f6498.4

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

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

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

    Alternative 4: 74.6% accurate, 1.5× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} t_1 := \cos t \cdot ew\\ t_2 := \left|t\_1\right|\\ t_3 := \sin t \cdot eh\\ \mathbf{if}\;ew \leq -2.2 \cdot 10^{-25}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;ew \leq 3.15 \cdot 10^{-183}:\\ \;\;\;\;\left|t\_3\right|\\ \mathbf{elif}\;ew \leq 3.9 \cdot 10^{-41}:\\ \;\;\;\;\frac{\mathsf{fma}\left(\frac{\tan t}{ew}, t\_3 \cdot eh, t\_1\right)}{\sqrt{{\left(\frac{\tan t \cdot eh}{ew}\right)}^{2} + 1}}\\ \mathbf{else}:\\ \;\;\;\;t\_2\\ \end{array} \end{array} \]
    (FPCore (eh ew t)
     :precision binary64
     (let* ((t_1 (* (cos t) ew)) (t_2 (fabs t_1)) (t_3 (* (sin t) eh)))
       (if (<= ew -2.2e-25)
         t_2
         (if (<= ew 3.15e-183)
           (fabs t_3)
           (if (<= ew 3.9e-41)
             (/
              (fma (/ (tan t) ew) (* t_3 eh) t_1)
              (sqrt (+ (pow (/ (* (tan t) eh) ew) 2.0) 1.0)))
             t_2)))))
    double code(double eh, double ew, double t) {
    	double t_1 = cos(t) * ew;
    	double t_2 = fabs(t_1);
    	double t_3 = sin(t) * eh;
    	double tmp;
    	if (ew <= -2.2e-25) {
    		tmp = t_2;
    	} else if (ew <= 3.15e-183) {
    		tmp = fabs(t_3);
    	} else if (ew <= 3.9e-41) {
    		tmp = fma((tan(t) / ew), (t_3 * eh), t_1) / sqrt((pow(((tan(t) * eh) / ew), 2.0) + 1.0));
    	} else {
    		tmp = t_2;
    	}
    	return tmp;
    }
    
    function code(eh, ew, t)
    	t_1 = Float64(cos(t) * ew)
    	t_2 = abs(t_1)
    	t_3 = Float64(sin(t) * eh)
    	tmp = 0.0
    	if (ew <= -2.2e-25)
    		tmp = t_2;
    	elseif (ew <= 3.15e-183)
    		tmp = abs(t_3);
    	elseif (ew <= 3.9e-41)
    		tmp = Float64(fma(Float64(tan(t) / ew), Float64(t_3 * eh), t_1) / sqrt(Float64((Float64(Float64(tan(t) * eh) / ew) ^ 2.0) + 1.0)));
    	else
    		tmp = t_2;
    	end
    	return tmp
    end
    
    code[eh_, ew_, t_] := Block[{t$95$1 = N[(N[Cos[t], $MachinePrecision] * ew), $MachinePrecision]}, Block[{t$95$2 = N[Abs[t$95$1], $MachinePrecision]}, Block[{t$95$3 = N[(N[Sin[t], $MachinePrecision] * eh), $MachinePrecision]}, If[LessEqual[ew, -2.2e-25], t$95$2, If[LessEqual[ew, 3.15e-183], N[Abs[t$95$3], $MachinePrecision], If[LessEqual[ew, 3.9e-41], N[(N[(N[(N[Tan[t], $MachinePrecision] / ew), $MachinePrecision] * N[(t$95$3 * eh), $MachinePrecision] + t$95$1), $MachinePrecision] / N[Sqrt[N[(N[Power[N[(N[(N[Tan[t], $MachinePrecision] * eh), $MachinePrecision] / ew), $MachinePrecision], 2.0], $MachinePrecision] + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], t$95$2]]]]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    t_1 := \cos t \cdot ew\\
    t_2 := \left|t\_1\right|\\
    t_3 := \sin t \cdot eh\\
    \mathbf{if}\;ew \leq -2.2 \cdot 10^{-25}:\\
    \;\;\;\;t\_2\\
    
    \mathbf{elif}\;ew \leq 3.15 \cdot 10^{-183}:\\
    \;\;\;\;\left|t\_3\right|\\
    
    \mathbf{elif}\;ew \leq 3.9 \cdot 10^{-41}:\\
    \;\;\;\;\frac{\mathsf{fma}\left(\frac{\tan t}{ew}, t\_3 \cdot eh, t\_1\right)}{\sqrt{{\left(\frac{\tan t \cdot eh}{ew}\right)}^{2} + 1}}\\
    
    \mathbf{else}:\\
    \;\;\;\;t\_2\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 3 regimes
    2. if ew < -2.2000000000000002e-25 or 3.89999999999999991e-41 < ew

      1. Initial program 99.8%

        \[\left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right| \]
      2. Add Preprocessing
      3. Step-by-step derivation
        1. lift-*.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| \]
        2. *-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| \]
        3. lift-*.f64N/A

          \[\leadsto \left|\cos \tan^{-1} \left(\frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t}{ew}\right) \cdot \color{blue}{\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| \]
        4. 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| \]
        5. lower-*.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 rewrites99.8%

        \[\leadsto \left|\color{blue}{\frac{ew}{\sqrt{{\left(\frac{-ew}{\tan t \cdot eh}\right)}^{-2} + 1}} \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. Taylor expanded in ew around inf

        \[\leadsto \left|\color{blue}{ew \cdot \cos t}\right| \]
      6. Step-by-step derivation
        1. *-commutativeN/A

          \[\leadsto \left|\color{blue}{\cos t \cdot ew}\right| \]
        2. lower-*.f64N/A

          \[\leadsto \left|\color{blue}{\cos t \cdot ew}\right| \]
        3. lower-cos.f6483.7

          \[\leadsto \left|\color{blue}{\cos t} \cdot ew\right| \]
      7. Applied rewrites83.7%

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

      if -2.2000000000000002e-25 < ew < 3.1499999999999999e-183

      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. lift-*.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| \]
        2. lift-*.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| \]
        3. associate-*l*N/A

          \[\leadsto \left|\color{blue}{ew \cdot \left(\cos t \cdot \cos \tan^{-1} \left(\frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t}{ew}\right)\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. *-commutativeN/A

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

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

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

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

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

          \[\leadsto \left|\color{blue}{\sin t \cdot eh}\right| \]
        2. lower-*.f64N/A

          \[\leadsto \left|\color{blue}{\sin t \cdot eh}\right| \]
        3. lower-sin.f6474.0

          \[\leadsto \left|\color{blue}{\sin t} \cdot eh\right| \]
      8. Applied rewrites74.0%

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

      if 3.1499999999999999e-183 < ew < 3.89999999999999991e-41

      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 rewrites83.1%

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

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

        \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(\frac{\tan t}{ew}, \left(\sin t \cdot eh\right) \cdot eh, ew \cdot \cos t\right)}{\sqrt{1 + {\left(\frac{eh \cdot \tan t}{ew}\right)}^{2}}}} \]
    3. Recombined 3 regimes into one program.
    4. Final simplification78.5%

      \[\leadsto \begin{array}{l} \mathbf{if}\;ew \leq -2.2 \cdot 10^{-25}:\\ \;\;\;\;\left|\cos t \cdot ew\right|\\ \mathbf{elif}\;ew \leq 3.15 \cdot 10^{-183}:\\ \;\;\;\;\left|\sin t \cdot eh\right|\\ \mathbf{elif}\;ew \leq 3.9 \cdot 10^{-41}:\\ \;\;\;\;\frac{\mathsf{fma}\left(\frac{\tan t}{ew}, \left(\sin t \cdot eh\right) \cdot eh, \cos t \cdot ew\right)}{\sqrt{{\left(\frac{\tan t \cdot eh}{ew}\right)}^{2} + 1}}\\ \mathbf{else}:\\ \;\;\;\;\left|\cos t \cdot ew\right|\\ \end{array} \]
    5. Add Preprocessing

    Alternative 5: 84.2% accurate, 1.5× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} t_1 := \sin t \cdot eh\\ \mathbf{if}\;eh \leq -1.6 \cdot 10^{+166}:\\ \;\;\;\;\left|\mathsf{fma}\left(\frac{{\cos t}^{2} \cdot -0.5}{t\_1}, ew \cdot ew, \sin t \cdot \left(-eh\right)\right)\right|\\ \mathbf{elif}\;eh \leq 7.5 \cdot 10^{+190}:\\ \;\;\;\;\left|\frac{\left(\frac{\tan t}{ew} \cdot eh\right) \cdot t\_1 + \cos t \cdot ew}{\sqrt{{\left(\frac{-ew}{\tan t \cdot eh}\right)}^{-2} + 1}}\right|\\ \mathbf{else}:\\ \;\;\;\;\left|t\_1\right|\\ \end{array} \end{array} \]
    (FPCore (eh ew t)
     :precision binary64
     (let* ((t_1 (* (sin t) eh)))
       (if (<= eh -1.6e+166)
         (fabs
          (fma (/ (* (pow (cos t) 2.0) -0.5) t_1) (* ew ew) (* (sin t) (- eh))))
         (if (<= eh 7.5e+190)
           (fabs
            (/
             (+ (* (* (/ (tan t) ew) eh) t_1) (* (cos t) ew))
             (sqrt (+ (pow (/ (- ew) (* (tan t) eh)) -2.0) 1.0))))
           (fabs t_1)))))
    double code(double eh, double ew, double t) {
    	double t_1 = sin(t) * eh;
    	double tmp;
    	if (eh <= -1.6e+166) {
    		tmp = fabs(fma(((pow(cos(t), 2.0) * -0.5) / t_1), (ew * ew), (sin(t) * -eh)));
    	} else if (eh <= 7.5e+190) {
    		tmp = fabs((((((tan(t) / ew) * eh) * t_1) + (cos(t) * ew)) / sqrt((pow((-ew / (tan(t) * eh)), -2.0) + 1.0))));
    	} else {
    		tmp = fabs(t_1);
    	}
    	return tmp;
    }
    
    function code(eh, ew, t)
    	t_1 = Float64(sin(t) * eh)
    	tmp = 0.0
    	if (eh <= -1.6e+166)
    		tmp = abs(fma(Float64(Float64((cos(t) ^ 2.0) * -0.5) / t_1), Float64(ew * ew), Float64(sin(t) * Float64(-eh))));
    	elseif (eh <= 7.5e+190)
    		tmp = abs(Float64(Float64(Float64(Float64(Float64(tan(t) / ew) * eh) * t_1) + Float64(cos(t) * ew)) / sqrt(Float64((Float64(Float64(-ew) / Float64(tan(t) * eh)) ^ -2.0) + 1.0))));
    	else
    		tmp = abs(t_1);
    	end
    	return tmp
    end
    
    code[eh_, ew_, t_] := Block[{t$95$1 = N[(N[Sin[t], $MachinePrecision] * eh), $MachinePrecision]}, If[LessEqual[eh, -1.6e+166], N[Abs[N[(N[(N[(N[Power[N[Cos[t], $MachinePrecision], 2.0], $MachinePrecision] * -0.5), $MachinePrecision] / t$95$1), $MachinePrecision] * N[(ew * ew), $MachinePrecision] + N[(N[Sin[t], $MachinePrecision] * (-eh)), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[eh, 7.5e+190], N[Abs[N[(N[(N[(N[(N[(N[Tan[t], $MachinePrecision] / ew), $MachinePrecision] * eh), $MachinePrecision] * t$95$1), $MachinePrecision] + N[(N[Cos[t], $MachinePrecision] * ew), $MachinePrecision]), $MachinePrecision] / N[Sqrt[N[(N[Power[N[((-ew) / N[(N[Tan[t], $MachinePrecision] * eh), $MachinePrecision]), $MachinePrecision], -2.0], $MachinePrecision] + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Abs[t$95$1], $MachinePrecision]]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    t_1 := \sin t \cdot eh\\
    \mathbf{if}\;eh \leq -1.6 \cdot 10^{+166}:\\
    \;\;\;\;\left|\mathsf{fma}\left(\frac{{\cos t}^{2} \cdot -0.5}{t\_1}, ew \cdot ew, \sin t \cdot \left(-eh\right)\right)\right|\\
    
    \mathbf{elif}\;eh \leq 7.5 \cdot 10^{+190}:\\
    \;\;\;\;\left|\frac{\left(\frac{\tan t}{ew} \cdot eh\right) \cdot t\_1 + \cos t \cdot ew}{\sqrt{{\left(\frac{-ew}{\tan t \cdot eh}\right)}^{-2} + 1}}\right|\\
    
    \mathbf{else}:\\
    \;\;\;\;\left|t\_1\right|\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 3 regimes
    2. if eh < -1.59999999999999984e166

      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. lift-*.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| \]
        2. lift-*.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| \]
        3. associate-*l*N/A

          \[\leadsto \left|\color{blue}{ew \cdot \left(\cos t \cdot \cos \tan^{-1} \left(\frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t}{ew}\right)\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. *-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

      if -1.59999999999999984e166 < eh < 7.4999999999999994e190

      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 rewrites88.5%

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

      if 7.4999999999999994e190 < eh

      1. Initial program 99.8%

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

          \[\leadsto \left|\color{blue}{ew \cdot \left(\cos t \cdot \cos \tan^{-1} \left(\frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t}{ew}\right)\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. *-commutativeN/A

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

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

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

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

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

          \[\leadsto \left|\color{blue}{\sin t \cdot eh}\right| \]
        2. lower-*.f64N/A

          \[\leadsto \left|\color{blue}{\sin t \cdot eh}\right| \]
        3. lower-sin.f6489.2

          \[\leadsto \left|\color{blue}{\sin t} \cdot eh\right| \]
      8. Applied rewrites89.2%

        \[\leadsto \left|\color{blue}{\sin t \cdot eh}\right| \]
    3. Recombined 3 regimes into one program.
    4. Final simplification87.0%

      \[\leadsto \begin{array}{l} \mathbf{if}\;eh \leq -1.6 \cdot 10^{+166}:\\ \;\;\;\;\left|\mathsf{fma}\left(\frac{{\cos t}^{2} \cdot -0.5}{\sin t \cdot eh}, ew \cdot ew, \sin t \cdot \left(-eh\right)\right)\right|\\ \mathbf{elif}\;eh \leq 7.5 \cdot 10^{+190}:\\ \;\;\;\;\left|\frac{\left(\frac{\tan t}{ew} \cdot eh\right) \cdot \left(\sin t \cdot eh\right) + \cos t \cdot ew}{\sqrt{{\left(\frac{-ew}{\tan t \cdot eh}\right)}^{-2} + 1}}\right|\\ \mathbf{else}:\\ \;\;\;\;\left|\sin t \cdot eh\right|\\ \end{array} \]
    5. Add Preprocessing

    Alternative 6: 83.5% accurate, 1.5× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} t_1 := \sin t \cdot eh\\ \mathbf{if}\;eh \leq -5.4 \cdot 10^{+177}:\\ \;\;\;\;\left|\mathsf{fma}\left(\frac{{\cos t}^{2} \cdot -0.5}{t\_1}, ew \cdot ew, \sin t \cdot \left(-eh\right)\right)\right|\\ \mathbf{elif}\;eh \leq 5.8 \cdot 10^{+190}:\\ \;\;\;\;\left|\frac{\mathsf{fma}\left(-\cos t, ew, \left(\frac{-eh}{ew} \cdot \tan t\right) \cdot t\_1\right)}{\sqrt{{\left(\frac{\tan t \cdot eh}{ew}\right)}^{2} + 1}}\right|\\ \mathbf{else}:\\ \;\;\;\;\left|t\_1\right|\\ \end{array} \end{array} \]
    (FPCore (eh ew t)
     :precision binary64
     (let* ((t_1 (* (sin t) eh)))
       (if (<= eh -5.4e+177)
         (fabs
          (fma (/ (* (pow (cos t) 2.0) -0.5) t_1) (* ew ew) (* (sin t) (- eh))))
         (if (<= eh 5.8e+190)
           (fabs
            (/
             (fma (- (cos t)) ew (* (* (/ (- eh) ew) (tan t)) t_1))
             (sqrt (+ (pow (/ (* (tan t) eh) ew) 2.0) 1.0))))
           (fabs t_1)))))
    double code(double eh, double ew, double t) {
    	double t_1 = sin(t) * eh;
    	double tmp;
    	if (eh <= -5.4e+177) {
    		tmp = fabs(fma(((pow(cos(t), 2.0) * -0.5) / t_1), (ew * ew), (sin(t) * -eh)));
    	} else if (eh <= 5.8e+190) {
    		tmp = fabs((fma(-cos(t), ew, (((-eh / ew) * tan(t)) * t_1)) / sqrt((pow(((tan(t) * eh) / ew), 2.0) + 1.0))));
    	} else {
    		tmp = fabs(t_1);
    	}
    	return tmp;
    }
    
    function code(eh, ew, t)
    	t_1 = Float64(sin(t) * eh)
    	tmp = 0.0
    	if (eh <= -5.4e+177)
    		tmp = abs(fma(Float64(Float64((cos(t) ^ 2.0) * -0.5) / t_1), Float64(ew * ew), Float64(sin(t) * Float64(-eh))));
    	elseif (eh <= 5.8e+190)
    		tmp = abs(Float64(fma(Float64(-cos(t)), ew, Float64(Float64(Float64(Float64(-eh) / ew) * tan(t)) * t_1)) / sqrt(Float64((Float64(Float64(tan(t) * eh) / ew) ^ 2.0) + 1.0))));
    	else
    		tmp = abs(t_1);
    	end
    	return tmp
    end
    
    code[eh_, ew_, t_] := Block[{t$95$1 = N[(N[Sin[t], $MachinePrecision] * eh), $MachinePrecision]}, If[LessEqual[eh, -5.4e+177], N[Abs[N[(N[(N[(N[Power[N[Cos[t], $MachinePrecision], 2.0], $MachinePrecision] * -0.5), $MachinePrecision] / t$95$1), $MachinePrecision] * N[(ew * ew), $MachinePrecision] + N[(N[Sin[t], $MachinePrecision] * (-eh)), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[eh, 5.8e+190], N[Abs[N[(N[((-N[Cos[t], $MachinePrecision]) * ew + N[(N[(N[((-eh) / ew), $MachinePrecision] * N[Tan[t], $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision] / N[Sqrt[N[(N[Power[N[(N[(N[Tan[t], $MachinePrecision] * eh), $MachinePrecision] / ew), $MachinePrecision], 2.0], $MachinePrecision] + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Abs[t$95$1], $MachinePrecision]]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    t_1 := \sin t \cdot eh\\
    \mathbf{if}\;eh \leq -5.4 \cdot 10^{+177}:\\
    \;\;\;\;\left|\mathsf{fma}\left(\frac{{\cos t}^{2} \cdot -0.5}{t\_1}, ew \cdot ew, \sin t \cdot \left(-eh\right)\right)\right|\\
    
    \mathbf{elif}\;eh \leq 5.8 \cdot 10^{+190}:\\
    \;\;\;\;\left|\frac{\mathsf{fma}\left(-\cos t, ew, \left(\frac{-eh}{ew} \cdot \tan t\right) \cdot t\_1\right)}{\sqrt{{\left(\frac{\tan t \cdot eh}{ew}\right)}^{2} + 1}}\right|\\
    
    \mathbf{else}:\\
    \;\;\;\;\left|t\_1\right|\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 3 regimes
    2. if eh < -5.39999999999999982e177

      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. lift-*.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| \]
        2. lift-*.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| \]
        3. associate-*l*N/A

          \[\leadsto \left|\color{blue}{ew \cdot \left(\cos t \cdot \cos \tan^{-1} \left(\frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t}{ew}\right)\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. *-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

      if -5.39999999999999982e177 < eh < 5.79999999999999979e190

      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. lift-*.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| \]
        2. lift-*.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| \]
        3. associate-*l*N/A

          \[\leadsto \left|\color{blue}{ew \cdot \left(\cos t \cdot \cos \tan^{-1} \left(\frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t}{ew}\right)\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. *-commutativeN/A

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

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

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

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

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

      if 5.79999999999999979e190 < eh

      1. Initial program 99.8%

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

          \[\leadsto \left|\color{blue}{ew \cdot \left(\cos t \cdot \cos \tan^{-1} \left(\frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t}{ew}\right)\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. *-commutativeN/A

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

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

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

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

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

          \[\leadsto \left|\color{blue}{\sin t \cdot eh}\right| \]
        2. lower-*.f64N/A

          \[\leadsto \left|\color{blue}{\sin t \cdot eh}\right| \]
        3. lower-sin.f6489.2

          \[\leadsto \left|\color{blue}{\sin t} \cdot eh\right| \]
      8. Applied rewrites89.2%

        \[\leadsto \left|\color{blue}{\sin t \cdot eh}\right| \]
    3. Recombined 3 regimes into one program.
    4. Final simplification87.0%

      \[\leadsto \begin{array}{l} \mathbf{if}\;eh \leq -5.4 \cdot 10^{+177}:\\ \;\;\;\;\left|\mathsf{fma}\left(\frac{{\cos t}^{2} \cdot -0.5}{\sin t \cdot eh}, ew \cdot ew, \sin t \cdot \left(-eh\right)\right)\right|\\ \mathbf{elif}\;eh \leq 5.8 \cdot 10^{+190}:\\ \;\;\;\;\left|\frac{\mathsf{fma}\left(-\cos t, ew, \left(\frac{-eh}{ew} \cdot \tan t\right) \cdot \left(\sin t \cdot eh\right)\right)}{\sqrt{{\left(\frac{\tan t \cdot eh}{ew}\right)}^{2} + 1}}\right|\\ \mathbf{else}:\\ \;\;\;\;\left|\sin t \cdot eh\right|\\ \end{array} \]
    5. Add Preprocessing

    Alternative 7: 83.5% accurate, 1.5× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} t_1 := \sin t \cdot eh\\ \mathbf{if}\;eh \leq -5.4 \cdot 10^{+177}:\\ \;\;\;\;\left|\mathsf{fma}\left(\frac{{\cos t}^{2} \cdot -0.5}{t\_1}, ew \cdot ew, \sin t \cdot \left(-eh\right)\right)\right|\\ \mathbf{elif}\;eh \leq 5.8 \cdot 10^{+190}:\\ \;\;\;\;\left|\frac{\left(\frac{eh}{ew} \cdot \tan t\right) \cdot t\_1 + \cos t \cdot ew}{\sqrt{{\left(\frac{\tan t \cdot eh}{ew}\right)}^{2} + 1}}\right|\\ \mathbf{else}:\\ \;\;\;\;\left|t\_1\right|\\ \end{array} \end{array} \]
    (FPCore (eh ew t)
     :precision binary64
     (let* ((t_1 (* (sin t) eh)))
       (if (<= eh -5.4e+177)
         (fabs
          (fma (/ (* (pow (cos t) 2.0) -0.5) t_1) (* ew ew) (* (sin t) (- eh))))
         (if (<= eh 5.8e+190)
           (fabs
            (/
             (+ (* (* (/ eh ew) (tan t)) t_1) (* (cos t) ew))
             (sqrt (+ (pow (/ (* (tan t) eh) ew) 2.0) 1.0))))
           (fabs t_1)))))
    double code(double eh, double ew, double t) {
    	double t_1 = sin(t) * eh;
    	double tmp;
    	if (eh <= -5.4e+177) {
    		tmp = fabs(fma(((pow(cos(t), 2.0) * -0.5) / t_1), (ew * ew), (sin(t) * -eh)));
    	} else if (eh <= 5.8e+190) {
    		tmp = fabs((((((eh / ew) * tan(t)) * t_1) + (cos(t) * ew)) / sqrt((pow(((tan(t) * eh) / ew), 2.0) + 1.0))));
    	} else {
    		tmp = fabs(t_1);
    	}
    	return tmp;
    }
    
    function code(eh, ew, t)
    	t_1 = Float64(sin(t) * eh)
    	tmp = 0.0
    	if (eh <= -5.4e+177)
    		tmp = abs(fma(Float64(Float64((cos(t) ^ 2.0) * -0.5) / t_1), Float64(ew * ew), Float64(sin(t) * Float64(-eh))));
    	elseif (eh <= 5.8e+190)
    		tmp = abs(Float64(Float64(Float64(Float64(Float64(eh / ew) * tan(t)) * t_1) + Float64(cos(t) * ew)) / sqrt(Float64((Float64(Float64(tan(t) * eh) / ew) ^ 2.0) + 1.0))));
    	else
    		tmp = abs(t_1);
    	end
    	return tmp
    end
    
    code[eh_, ew_, t_] := Block[{t$95$1 = N[(N[Sin[t], $MachinePrecision] * eh), $MachinePrecision]}, If[LessEqual[eh, -5.4e+177], N[Abs[N[(N[(N[(N[Power[N[Cos[t], $MachinePrecision], 2.0], $MachinePrecision] * -0.5), $MachinePrecision] / t$95$1), $MachinePrecision] * N[(ew * ew), $MachinePrecision] + N[(N[Sin[t], $MachinePrecision] * (-eh)), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[eh, 5.8e+190], N[Abs[N[(N[(N[(N[(N[(eh / ew), $MachinePrecision] * N[Tan[t], $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision] + N[(N[Cos[t], $MachinePrecision] * ew), $MachinePrecision]), $MachinePrecision] / N[Sqrt[N[(N[Power[N[(N[(N[Tan[t], $MachinePrecision] * eh), $MachinePrecision] / ew), $MachinePrecision], 2.0], $MachinePrecision] + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Abs[t$95$1], $MachinePrecision]]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    t_1 := \sin t \cdot eh\\
    \mathbf{if}\;eh \leq -5.4 \cdot 10^{+177}:\\
    \;\;\;\;\left|\mathsf{fma}\left(\frac{{\cos t}^{2} \cdot -0.5}{t\_1}, ew \cdot ew, \sin t \cdot \left(-eh\right)\right)\right|\\
    
    \mathbf{elif}\;eh \leq 5.8 \cdot 10^{+190}:\\
    \;\;\;\;\left|\frac{\left(\frac{eh}{ew} \cdot \tan t\right) \cdot t\_1 + \cos t \cdot ew}{\sqrt{{\left(\frac{\tan t \cdot eh}{ew}\right)}^{2} + 1}}\right|\\
    
    \mathbf{else}:\\
    \;\;\;\;\left|t\_1\right|\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 3 regimes
    2. if eh < -5.39999999999999982e177

      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. lift-*.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| \]
        2. lift-*.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| \]
        3. associate-*l*N/A

          \[\leadsto \left|\color{blue}{ew \cdot \left(\cos t \cdot \cos \tan^{-1} \left(\frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t}{ew}\right)\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. *-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

      if -5.39999999999999982e177 < eh < 5.79999999999999979e190

      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. lift-*.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| \]
        2. lift-*.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| \]
        3. associate-*l*N/A

          \[\leadsto \left|\color{blue}{ew \cdot \left(\cos t \cdot \cos \tan^{-1} \left(\frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t}{ew}\right)\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. *-commutativeN/A

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

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

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

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

      if 5.79999999999999979e190 < eh

      1. Initial program 99.8%

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

          \[\leadsto \left|\color{blue}{ew \cdot \left(\cos t \cdot \cos \tan^{-1} \left(\frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t}{ew}\right)\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. *-commutativeN/A

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

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

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

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

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

          \[\leadsto \left|\color{blue}{\sin t \cdot eh}\right| \]
        2. lower-*.f64N/A

          \[\leadsto \left|\color{blue}{\sin t \cdot eh}\right| \]
        3. lower-sin.f6489.2

          \[\leadsto \left|\color{blue}{\sin t} \cdot eh\right| \]
      8. Applied rewrites89.2%

        \[\leadsto \left|\color{blue}{\sin t \cdot eh}\right| \]
    3. Recombined 3 regimes into one program.
    4. Final simplification87.0%

      \[\leadsto \begin{array}{l} \mathbf{if}\;eh \leq -5.4 \cdot 10^{+177}:\\ \;\;\;\;\left|\mathsf{fma}\left(\frac{{\cos t}^{2} \cdot -0.5}{\sin t \cdot eh}, ew \cdot ew, \sin t \cdot \left(-eh\right)\right)\right|\\ \mathbf{elif}\;eh \leq 5.8 \cdot 10^{+190}:\\ \;\;\;\;\left|\frac{\left(\frac{eh}{ew} \cdot \tan t\right) \cdot \left(\sin t \cdot eh\right) + \cos t \cdot ew}{\sqrt{{\left(\frac{\tan t \cdot eh}{ew}\right)}^{2} + 1}}\right|\\ \mathbf{else}:\\ \;\;\;\;\left|\sin t \cdot eh\right|\\ \end{array} \]
    5. Add Preprocessing

    Alternative 8: 82.0% accurate, 1.5× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} t_1 := \sin t \cdot eh\\ \mathbf{if}\;eh \leq -2.1 \cdot 10^{+131}:\\ \;\;\;\;\left|\mathsf{fma}\left(\frac{{\cos t}^{2} \cdot -0.5}{t\_1}, ew \cdot ew, \sin t \cdot \left(-eh\right)\right)\right|\\ \mathbf{elif}\;eh \leq 4.8 \cdot 10^{+179}:\\ \;\;\;\;\left|\frac{\mathsf{fma}\left(t\_1 \cdot eh, \frac{\tan t}{ew}, \cos t \cdot ew\right)}{\sqrt{{\left(\frac{-ew}{\tan t \cdot eh}\right)}^{-2} + 1}}\right|\\ \mathbf{else}:\\ \;\;\;\;\left|t\_1\right|\\ \end{array} \end{array} \]
    (FPCore (eh ew t)
     :precision binary64
     (let* ((t_1 (* (sin t) eh)))
       (if (<= eh -2.1e+131)
         (fabs
          (fma (/ (* (pow (cos t) 2.0) -0.5) t_1) (* ew ew) (* (sin t) (- eh))))
         (if (<= eh 4.8e+179)
           (fabs
            (/
             (fma (* t_1 eh) (/ (tan t) ew) (* (cos t) ew))
             (sqrt (+ (pow (/ (- ew) (* (tan t) eh)) -2.0) 1.0))))
           (fabs t_1)))))
    double code(double eh, double ew, double t) {
    	double t_1 = sin(t) * eh;
    	double tmp;
    	if (eh <= -2.1e+131) {
    		tmp = fabs(fma(((pow(cos(t), 2.0) * -0.5) / t_1), (ew * ew), (sin(t) * -eh)));
    	} else if (eh <= 4.8e+179) {
    		tmp = fabs((fma((t_1 * eh), (tan(t) / ew), (cos(t) * ew)) / sqrt((pow((-ew / (tan(t) * eh)), -2.0) + 1.0))));
    	} else {
    		tmp = fabs(t_1);
    	}
    	return tmp;
    }
    
    function code(eh, ew, t)
    	t_1 = Float64(sin(t) * eh)
    	tmp = 0.0
    	if (eh <= -2.1e+131)
    		tmp = abs(fma(Float64(Float64((cos(t) ^ 2.0) * -0.5) / t_1), Float64(ew * ew), Float64(sin(t) * Float64(-eh))));
    	elseif (eh <= 4.8e+179)
    		tmp = abs(Float64(fma(Float64(t_1 * eh), Float64(tan(t) / ew), Float64(cos(t) * ew)) / sqrt(Float64((Float64(Float64(-ew) / Float64(tan(t) * eh)) ^ -2.0) + 1.0))));
    	else
    		tmp = abs(t_1);
    	end
    	return tmp
    end
    
    code[eh_, ew_, t_] := Block[{t$95$1 = N[(N[Sin[t], $MachinePrecision] * eh), $MachinePrecision]}, If[LessEqual[eh, -2.1e+131], N[Abs[N[(N[(N[(N[Power[N[Cos[t], $MachinePrecision], 2.0], $MachinePrecision] * -0.5), $MachinePrecision] / t$95$1), $MachinePrecision] * N[(ew * ew), $MachinePrecision] + N[(N[Sin[t], $MachinePrecision] * (-eh)), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[eh, 4.8e+179], N[Abs[N[(N[(N[(t$95$1 * eh), $MachinePrecision] * N[(N[Tan[t], $MachinePrecision] / ew), $MachinePrecision] + N[(N[Cos[t], $MachinePrecision] * ew), $MachinePrecision]), $MachinePrecision] / N[Sqrt[N[(N[Power[N[((-ew) / N[(N[Tan[t], $MachinePrecision] * eh), $MachinePrecision]), $MachinePrecision], -2.0], $MachinePrecision] + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Abs[t$95$1], $MachinePrecision]]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    t_1 := \sin t \cdot eh\\
    \mathbf{if}\;eh \leq -2.1 \cdot 10^{+131}:\\
    \;\;\;\;\left|\mathsf{fma}\left(\frac{{\cos t}^{2} \cdot -0.5}{t\_1}, ew \cdot ew, \sin t \cdot \left(-eh\right)\right)\right|\\
    
    \mathbf{elif}\;eh \leq 4.8 \cdot 10^{+179}:\\
    \;\;\;\;\left|\frac{\mathsf{fma}\left(t\_1 \cdot eh, \frac{\tan t}{ew}, \cos t \cdot ew\right)}{\sqrt{{\left(\frac{-ew}{\tan t \cdot eh}\right)}^{-2} + 1}}\right|\\
    
    \mathbf{else}:\\
    \;\;\;\;\left|t\_1\right|\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 3 regimes
    2. if eh < -2.09999999999999985e131

      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. lift-*.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| \]
        2. lift-*.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| \]
        3. associate-*l*N/A

          \[\leadsto \left|\color{blue}{ew \cdot \left(\cos t \cdot \cos \tan^{-1} \left(\frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t}{ew}\right)\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. *-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

      if -2.09999999999999985e131 < eh < 4.80000000000000025e179

      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 rewrites88.9%

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

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

      if 4.80000000000000025e179 < eh

      1. Initial program 99.8%

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

          \[\leadsto \left|\color{blue}{ew \cdot \left(\cos t \cdot \cos \tan^{-1} \left(\frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t}{ew}\right)\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. *-commutativeN/A

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

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

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

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

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

          \[\leadsto \left|\color{blue}{\sin t \cdot eh}\right| \]
        2. lower-*.f64N/A

          \[\leadsto \left|\color{blue}{\sin t \cdot eh}\right| \]
        3. lower-sin.f6486.8

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

        \[\leadsto \left|\color{blue}{\sin t \cdot eh}\right| \]
    3. Recombined 3 regimes into one program.
    4. Final simplification84.6%

      \[\leadsto \begin{array}{l} \mathbf{if}\;eh \leq -2.1 \cdot 10^{+131}:\\ \;\;\;\;\left|\mathsf{fma}\left(\frac{{\cos t}^{2} \cdot -0.5}{\sin t \cdot eh}, ew \cdot ew, \sin t \cdot \left(-eh\right)\right)\right|\\ \mathbf{elif}\;eh \leq 4.8 \cdot 10^{+179}:\\ \;\;\;\;\left|\frac{\mathsf{fma}\left(\left(\sin t \cdot eh\right) \cdot eh, \frac{\tan t}{ew}, \cos t \cdot ew\right)}{\sqrt{{\left(\frac{-ew}{\tan t \cdot eh}\right)}^{-2} + 1}}\right|\\ \mathbf{else}:\\ \;\;\;\;\left|\sin t \cdot eh\right|\\ \end{array} \]
    5. Add Preprocessing

    Alternative 9: 82.0% accurate, 1.5× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} t_1 := \sin t \cdot eh\\ \mathbf{if}\;eh \leq -2.1 \cdot 10^{+131}:\\ \;\;\;\;\left|\mathsf{fma}\left(\frac{{\cos t}^{2} \cdot -0.5}{t\_1}, ew \cdot ew, \sin t \cdot \left(-eh\right)\right)\right|\\ \mathbf{elif}\;eh \leq 4.8 \cdot 10^{+179}:\\ \;\;\;\;\frac{\left|\mathsf{fma}\left(\frac{\tan t}{ew}, t\_1 \cdot eh, \cos t \cdot ew\right)\right|}{\sqrt{{\left(\frac{\tan t \cdot eh}{ew}\right)}^{2} + 1}}\\ \mathbf{else}:\\ \;\;\;\;\left|t\_1\right|\\ \end{array} \end{array} \]
    (FPCore (eh ew t)
     :precision binary64
     (let* ((t_1 (* (sin t) eh)))
       (if (<= eh -2.1e+131)
         (fabs
          (fma (/ (* (pow (cos t) 2.0) -0.5) t_1) (* ew ew) (* (sin t) (- eh))))
         (if (<= eh 4.8e+179)
           (/
            (fabs (fma (/ (tan t) ew) (* t_1 eh) (* (cos t) ew)))
            (sqrt (+ (pow (/ (* (tan t) eh) ew) 2.0) 1.0)))
           (fabs t_1)))))
    double code(double eh, double ew, double t) {
    	double t_1 = sin(t) * eh;
    	double tmp;
    	if (eh <= -2.1e+131) {
    		tmp = fabs(fma(((pow(cos(t), 2.0) * -0.5) / t_1), (ew * ew), (sin(t) * -eh)));
    	} else if (eh <= 4.8e+179) {
    		tmp = fabs(fma((tan(t) / ew), (t_1 * eh), (cos(t) * ew))) / sqrt((pow(((tan(t) * eh) / ew), 2.0) + 1.0));
    	} else {
    		tmp = fabs(t_1);
    	}
    	return tmp;
    }
    
    function code(eh, ew, t)
    	t_1 = Float64(sin(t) * eh)
    	tmp = 0.0
    	if (eh <= -2.1e+131)
    		tmp = abs(fma(Float64(Float64((cos(t) ^ 2.0) * -0.5) / t_1), Float64(ew * ew), Float64(sin(t) * Float64(-eh))));
    	elseif (eh <= 4.8e+179)
    		tmp = Float64(abs(fma(Float64(tan(t) / ew), Float64(t_1 * eh), Float64(cos(t) * ew))) / sqrt(Float64((Float64(Float64(tan(t) * eh) / ew) ^ 2.0) + 1.0)));
    	else
    		tmp = abs(t_1);
    	end
    	return tmp
    end
    
    code[eh_, ew_, t_] := Block[{t$95$1 = N[(N[Sin[t], $MachinePrecision] * eh), $MachinePrecision]}, If[LessEqual[eh, -2.1e+131], N[Abs[N[(N[(N[(N[Power[N[Cos[t], $MachinePrecision], 2.0], $MachinePrecision] * -0.5), $MachinePrecision] / t$95$1), $MachinePrecision] * N[(ew * ew), $MachinePrecision] + N[(N[Sin[t], $MachinePrecision] * (-eh)), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[eh, 4.8e+179], N[(N[Abs[N[(N[(N[Tan[t], $MachinePrecision] / ew), $MachinePrecision] * N[(t$95$1 * eh), $MachinePrecision] + N[(N[Cos[t], $MachinePrecision] * ew), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[Sqrt[N[(N[Power[N[(N[(N[Tan[t], $MachinePrecision] * eh), $MachinePrecision] / ew), $MachinePrecision], 2.0], $MachinePrecision] + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[Abs[t$95$1], $MachinePrecision]]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    t_1 := \sin t \cdot eh\\
    \mathbf{if}\;eh \leq -2.1 \cdot 10^{+131}:\\
    \;\;\;\;\left|\mathsf{fma}\left(\frac{{\cos t}^{2} \cdot -0.5}{t\_1}, ew \cdot ew, \sin t \cdot \left(-eh\right)\right)\right|\\
    
    \mathbf{elif}\;eh \leq 4.8 \cdot 10^{+179}:\\
    \;\;\;\;\frac{\left|\mathsf{fma}\left(\frac{\tan t}{ew}, t\_1 \cdot eh, \cos t \cdot ew\right)\right|}{\sqrt{{\left(\frac{\tan t \cdot eh}{ew}\right)}^{2} + 1}}\\
    
    \mathbf{else}:\\
    \;\;\;\;\left|t\_1\right|\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 3 regimes
    2. if eh < -2.09999999999999985e131

      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. lift-*.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| \]
        2. lift-*.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| \]
        3. associate-*l*N/A

          \[\leadsto \left|\color{blue}{ew \cdot \left(\cos t \cdot \cos \tan^{-1} \left(\frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t}{ew}\right)\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. *-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

      if -2.09999999999999985e131 < eh < 4.80000000000000025e179

      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 rewrites88.9%

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

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

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

      if 4.80000000000000025e179 < eh

      1. Initial program 99.8%

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

          \[\leadsto \left|\color{blue}{ew \cdot \left(\cos t \cdot \cos \tan^{-1} \left(\frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t}{ew}\right)\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. *-commutativeN/A

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

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

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

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

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

          \[\leadsto \left|\color{blue}{\sin t \cdot eh}\right| \]
        2. lower-*.f64N/A

          \[\leadsto \left|\color{blue}{\sin t \cdot eh}\right| \]
        3. lower-sin.f6486.8

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

        \[\leadsto \left|\color{blue}{\sin t \cdot eh}\right| \]
    3. Recombined 3 regimes into one program.
    4. Final simplification84.6%

      \[\leadsto \begin{array}{l} \mathbf{if}\;eh \leq -2.1 \cdot 10^{+131}:\\ \;\;\;\;\left|\mathsf{fma}\left(\frac{{\cos t}^{2} \cdot -0.5}{\sin t \cdot eh}, ew \cdot ew, \sin t \cdot \left(-eh\right)\right)\right|\\ \mathbf{elif}\;eh \leq 4.8 \cdot 10^{+179}:\\ \;\;\;\;\frac{\left|\mathsf{fma}\left(\frac{\tan t}{ew}, \left(\sin t \cdot eh\right) \cdot eh, \cos t \cdot ew\right)\right|}{\sqrt{{\left(\frac{\tan t \cdot eh}{ew}\right)}^{2} + 1}}\\ \mathbf{else}:\\ \;\;\;\;\left|\sin t \cdot eh\right|\\ \end{array} \]
    5. Add Preprocessing

    Alternative 10: 74.8% accurate, 7.2× speedup?

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

      1. Initial program 99.8%

        \[\left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right| \]
      2. Add Preprocessing
      3. Step-by-step derivation
        1. lift-*.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| \]
        2. *-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| \]
        3. lift-*.f64N/A

          \[\leadsto \left|\cos \tan^{-1} \left(\frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t}{ew}\right) \cdot \color{blue}{\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| \]
        4. 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| \]
        5. lower-*.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 rewrites99.8%

        \[\leadsto \left|\color{blue}{\frac{ew}{\sqrt{{\left(\frac{-ew}{\tan t \cdot eh}\right)}^{-2} + 1}} \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. Taylor expanded in ew around inf

        \[\leadsto \left|\color{blue}{ew \cdot \cos t}\right| \]
      6. Step-by-step derivation
        1. *-commutativeN/A

          \[\leadsto \left|\color{blue}{\cos t \cdot ew}\right| \]
        2. lower-*.f64N/A

          \[\leadsto \left|\color{blue}{\cos t \cdot ew}\right| \]
        3. lower-cos.f6479.9

          \[\leadsto \left|\color{blue}{\cos t} \cdot ew\right| \]
      7. Applied rewrites79.9%

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

      if -2.2000000000000002e-25 < ew < 1.60000000000000006e-107

      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. lift-*.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| \]
        2. lift-*.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| \]
        3. associate-*l*N/A

          \[\leadsto \left|\color{blue}{ew \cdot \left(\cos t \cdot \cos \tan^{-1} \left(\frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t}{ew}\right)\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. *-commutativeN/A

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

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

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

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

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

          \[\leadsto \left|\color{blue}{\sin t \cdot eh}\right| \]
        2. lower-*.f64N/A

          \[\leadsto \left|\color{blue}{\sin t \cdot eh}\right| \]
        3. lower-sin.f6472.2

          \[\leadsto \left|\color{blue}{\sin t} \cdot eh\right| \]
      8. Applied rewrites72.2%

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

    Alternative 11: 60.8% accurate, 8.0× speedup?

    \[\begin{array}{l} \\ \left|\cos t \cdot ew\right| \end{array} \]
    (FPCore (eh ew t) :precision binary64 (fabs (* (cos t) ew)))
    double code(double eh, double ew, double t) {
    	return fabs((cos(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((cos(t) * ew))
    end function
    
    public static double code(double eh, double ew, double t) {
    	return Math.abs((Math.cos(t) * ew));
    }
    
    def code(eh, ew, t):
    	return math.fabs((math.cos(t) * ew))
    
    function code(eh, ew, t)
    	return abs(Float64(cos(t) * ew))
    end
    
    function tmp = code(eh, ew, t)
    	tmp = abs((cos(t) * ew));
    end
    
    code[eh_, ew_, t_] := N[Abs[N[(N[Cos[t], $MachinePrecision] * ew), $MachinePrecision]], $MachinePrecision]
    
    \begin{array}{l}
    
    \\
    \left|\cos t \cdot ew\right|
    \end{array}
    
    Derivation
    1. Initial program 99.8%

      \[\left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right| \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. lift-*.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| \]
      2. *-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| \]
      3. lift-*.f64N/A

        \[\leadsto \left|\cos \tan^{-1} \left(\frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t}{ew}\right) \cdot \color{blue}{\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| \]
      4. 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| \]
      5. lower-*.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 rewrites99.8%

      \[\leadsto \left|\color{blue}{\frac{ew}{\sqrt{{\left(\frac{-ew}{\tan t \cdot eh}\right)}^{-2} + 1}} \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. Taylor expanded in ew around inf

      \[\leadsto \left|\color{blue}{ew \cdot \cos t}\right| \]
    6. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \left|\color{blue}{\cos t \cdot ew}\right| \]
      2. lower-*.f64N/A

        \[\leadsto \left|\color{blue}{\cos t \cdot ew}\right| \]
      3. lower-cos.f6461.8

        \[\leadsto \left|\color{blue}{\cos t} \cdot ew\right| \]
    7. Applied rewrites61.8%

      \[\leadsto \left|\color{blue}{\cos t \cdot ew}\right| \]
    8. Add Preprocessing

    Alternative 12: 41.8% accurate, 172.4× 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(Float64(-ew))
    end
    
    function tmp = code(eh, ew, t)
    	tmp = abs(-ew);
    end
    
    code[eh_, ew_, t_] := N[Abs[(-ew)], $MachinePrecision]
    
    \begin{array}{l}
    
    \\
    \left|-ew\right|
    \end{array}
    
    Derivation
    1. Initial program 99.8%

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

        \[\leadsto \left|\color{blue}{ew \cdot \left(\cos t \cdot \cos \tan^{-1} \left(\frac{\left(\mathsf{neg}\left(eh\right)\right) \cdot \tan t}{ew}\right)\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. *-commutativeN/A

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

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

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

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

      \[\leadsto \left|\color{blue}{-1 \cdot ew}\right| \]
    7. Step-by-step derivation
      1. mul-1-negN/A

        \[\leadsto \left|\color{blue}{\mathsf{neg}\left(ew\right)}\right| \]
      2. lower-neg.f6441.6

        \[\leadsto \left|\color{blue}{-ew}\right| \]
    8. Applied rewrites41.6%

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

    Reproduce

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