Example from Robby

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

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 9 alternatives:

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

Initial Program: 99.8% accurate, 1.0× speedup?

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

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

Alternative 1: 99.8% accurate, 1.0× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 99.7% accurate, 1.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \tan^{-1} \left(\frac{eh}{ew \cdot \tan t}\right)\\ t_2 := \frac{1}{\left|\frac{1}{\mathsf{fma}\left(eh, \cos t \cdot \sin t\_1, \frac{ew \cdot \sin t}{\sqrt{\mathsf{fma}\left({\tan t}^{-2}, \frac{eh}{ew} \cdot \frac{eh}{ew}, 1\right)}}\right)}\right|}\\ \mathbf{if}\;t \leq -0.0003:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;t \leq 0.005:\\ \;\;\;\;\left|t \cdot \left(\cos t\_1 \cdot \mathsf{fma}\left(ew, \left(t \cdot t\right) \cdot -0.16666666666666666, ew\right)\right) + \mathsf{fma}\left(t \cdot t, \mathsf{fma}\left(eh \cdot \left(t \cdot t\right), 0.041666666666666664, eh \cdot -0.5\right), eh\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right|\\ \mathbf{else}:\\ \;\;\;\;t\_2\\ \end{array} \end{array} \]
(FPCore (eh ew t)
 :precision binary64
 (let* ((t_1 (atan (/ eh (* ew (tan t)))))
        (t_2
         (/
          1.0
          (fabs
           (/
            1.0
            (fma
             eh
             (* (cos t) (sin t_1))
             (/
              (* ew (sin t))
              (sqrt
               (fma (pow (tan t) -2.0) (* (/ eh ew) (/ eh ew)) 1.0)))))))))
   (if (<= t -0.0003)
     t_2
     (if (<= t 0.005)
       (fabs
        (+
         (* t (* (cos t_1) (fma ew (* (* t t) -0.16666666666666666) ew)))
         (*
          (fma
           (* t t)
           (fma (* eh (* t t)) 0.041666666666666664 (* eh -0.5))
           eh)
          (sin (atan (/ (/ eh ew) (tan t)))))))
       t_2))))
double code(double eh, double ew, double t) {
	double t_1 = atan((eh / (ew * tan(t))));
	double t_2 = 1.0 / fabs((1.0 / fma(eh, (cos(t) * sin(t_1)), ((ew * sin(t)) / sqrt(fma(pow(tan(t), -2.0), ((eh / ew) * (eh / ew)), 1.0))))));
	double tmp;
	if (t <= -0.0003) {
		tmp = t_2;
	} else if (t <= 0.005) {
		tmp = fabs(((t * (cos(t_1) * fma(ew, ((t * t) * -0.16666666666666666), ew))) + (fma((t * t), fma((eh * (t * t)), 0.041666666666666664, (eh * -0.5)), eh) * sin(atan(((eh / ew) / tan(t)))))));
	} else {
		tmp = t_2;
	}
	return tmp;
}
function code(eh, ew, t)
	t_1 = atan(Float64(eh / Float64(ew * tan(t))))
	t_2 = Float64(1.0 / abs(Float64(1.0 / fma(eh, Float64(cos(t) * sin(t_1)), Float64(Float64(ew * sin(t)) / sqrt(fma((tan(t) ^ -2.0), Float64(Float64(eh / ew) * Float64(eh / ew)), 1.0)))))))
	tmp = 0.0
	if (t <= -0.0003)
		tmp = t_2;
	elseif (t <= 0.005)
		tmp = abs(Float64(Float64(t * Float64(cos(t_1) * fma(ew, Float64(Float64(t * t) * -0.16666666666666666), ew))) + Float64(fma(Float64(t * t), fma(Float64(eh * Float64(t * t)), 0.041666666666666664, Float64(eh * -0.5)), eh) * sin(atan(Float64(Float64(eh / ew) / tan(t)))))));
	else
		tmp = t_2;
	end
	return tmp
end
code[eh_, ew_, t_] := Block[{t$95$1 = N[ArcTan[N[(eh / N[(ew * N[Tan[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[(1.0 / N[Abs[N[(1.0 / N[(eh * N[(N[Cos[t], $MachinePrecision] * N[Sin[t$95$1], $MachinePrecision]), $MachinePrecision] + N[(N[(ew * N[Sin[t], $MachinePrecision]), $MachinePrecision] / N[Sqrt[N[(N[Power[N[Tan[t], $MachinePrecision], -2.0], $MachinePrecision] * N[(N[(eh / ew), $MachinePrecision] * N[(eh / ew), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -0.0003], t$95$2, If[LessEqual[t, 0.005], N[Abs[N[(N[(t * N[(N[Cos[t$95$1], $MachinePrecision] * N[(ew * N[(N[(t * t), $MachinePrecision] * -0.16666666666666666), $MachinePrecision] + ew), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(t * t), $MachinePrecision] * N[(N[(eh * N[(t * t), $MachinePrecision]), $MachinePrecision] * 0.041666666666666664 + N[(eh * -0.5), $MachinePrecision]), $MachinePrecision] + eh), $MachinePrecision] * N[Sin[N[ArcTan[N[(N[(eh / ew), $MachinePrecision] / N[Tan[t], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], t$95$2]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \tan^{-1} \left(\frac{eh}{ew \cdot \tan t}\right)\\
t_2 := \frac{1}{\left|\frac{1}{\mathsf{fma}\left(eh, \cos t \cdot \sin t\_1, \frac{ew \cdot \sin t}{\sqrt{\mathsf{fma}\left({\tan t}^{-2}, \frac{eh}{ew} \cdot \frac{eh}{ew}, 1\right)}}\right)}\right|}\\
\mathbf{if}\;t \leq -0.0003:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;t \leq 0.005:\\
\;\;\;\;\left|t \cdot \left(\cos t\_1 \cdot \mathsf{fma}\left(ew, \left(t \cdot t\right) \cdot -0.16666666666666666, ew\right)\right) + \mathsf{fma}\left(t \cdot t, \mathsf{fma}\left(eh \cdot \left(t \cdot t\right), 0.041666666666666664, eh \cdot -0.5\right), eh\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right|\\

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


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

    1. Initial program 99.6%

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

      \[\leadsto \color{blue}{\frac{1}{\left|\frac{1}{\mathsf{fma}\left(eh, \cos t \cdot \sin \tan^{-1} \left(\frac{eh}{ew \cdot \tan t}\right), \frac{ew \cdot \sin t}{\sqrt{\mathsf{fma}\left(eh \cdot eh, {\left(ew \cdot \tan t\right)}^{-2}, 1\right)}}\right)}\right|}} \]
    4. Step-by-step derivation
      1. lift-fma.f64N/A

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

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

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

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

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

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

    if -2.99999999999999974e-4 < t < 0.0050000000000000001

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left|t \cdot \left(\cos \tan^{-1} \left(\frac{eh}{ew \cdot \tan t}\right) \cdot \mathsf{fma}\left(ew, \left(t \cdot t\right) \cdot \frac{-1}{6}, ew\right)\right) + \color{blue}{\mathsf{fma}\left({t}^{2}, \frac{-1}{2} \cdot eh + \frac{1}{24} \cdot \left(eh \cdot {t}^{2}\right), eh\right)} \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
      3. unpow2N/A

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

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

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

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

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

        \[\leadsto \left|t \cdot \left(\cos \tan^{-1} \left(\frac{eh}{ew \cdot \tan t}\right) \cdot \mathsf{fma}\left(ew, \left(t \cdot t\right) \cdot \frac{-1}{6}, ew\right)\right) + \mathsf{fma}\left(t \cdot t, \mathsf{fma}\left(\color{blue}{eh \cdot {t}^{2}}, \frac{1}{24}, \frac{-1}{2} \cdot eh\right), eh\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
      9. unpow2N/A

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

        \[\leadsto \left|t \cdot \left(\cos \tan^{-1} \left(\frac{eh}{ew \cdot \tan t}\right) \cdot \mathsf{fma}\left(ew, \left(t \cdot t\right) \cdot \frac{-1}{6}, ew\right)\right) + \mathsf{fma}\left(t \cdot t, \mathsf{fma}\left(eh \cdot \color{blue}{\left(t \cdot t\right)}, \frac{1}{24}, \frac{-1}{2} \cdot eh\right), eh\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
      11. *-commutativeN/A

        \[\leadsto \left|t \cdot \left(\cos \tan^{-1} \left(\frac{eh}{ew \cdot \tan t}\right) \cdot \mathsf{fma}\left(ew, \left(t \cdot t\right) \cdot \frac{-1}{6}, ew\right)\right) + \mathsf{fma}\left(t \cdot t, \mathsf{fma}\left(eh \cdot \left(t \cdot t\right), \frac{1}{24}, \color{blue}{eh \cdot \frac{-1}{2}}\right), eh\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
      12. lower-*.f64100.0

        \[\leadsto \left|t \cdot \left(\cos \tan^{-1} \left(\frac{eh}{ew \cdot \tan t}\right) \cdot \mathsf{fma}\left(ew, \left(t \cdot t\right) \cdot -0.16666666666666666, ew\right)\right) + \mathsf{fma}\left(t \cdot t, \mathsf{fma}\left(eh \cdot \left(t \cdot t\right), 0.041666666666666664, \color{blue}{eh \cdot -0.5}\right), eh\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
    8. Applied rewrites100.0%

      \[\leadsto \left|t \cdot \left(\cos \tan^{-1} \left(\frac{eh}{ew \cdot \tan t}\right) \cdot \mathsf{fma}\left(ew, \left(t \cdot t\right) \cdot -0.16666666666666666, ew\right)\right) + \color{blue}{\mathsf{fma}\left(t \cdot t, \mathsf{fma}\left(eh \cdot \left(t \cdot t\right), 0.041666666666666664, eh \cdot -0.5\right), eh\right)} \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 3: 98.1% accurate, 1.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \sin \tan^{-1} \left(\frac{eh}{ew \cdot \tan t}\right)\\ t_2 := \left|eh \cdot \left(ew \cdot \mathsf{fma}\left(\cos t, \frac{t\_1}{ew}, \cos \tan^{-1} \left(\frac{eh}{ew \cdot t}\right) \cdot \frac{\sin t}{eh}\right)\right)\right|\\ \mathbf{if}\;eh \leq -1.52 \cdot 10^{-12}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;eh \leq 1.85 \cdot 10^{-91}:\\ \;\;\;\;\frac{1}{\left|\frac{1}{ew \cdot \mathsf{fma}\left(eh, \frac{\cos t \cdot t\_1}{ew}, \sin t\right)}\right|}\\ \mathbf{else}:\\ \;\;\;\;t\_2\\ \end{array} \end{array} \]
(FPCore (eh ew t)
 :precision binary64
 (let* ((t_1 (sin (atan (/ eh (* ew (tan t))))))
        (t_2
         (fabs
          (*
           eh
           (*
            ew
            (fma
             (cos t)
             (/ t_1 ew)
             (* (cos (atan (/ eh (* ew t)))) (/ (sin t) eh))))))))
   (if (<= eh -1.52e-12)
     t_2
     (if (<= eh 1.85e-91)
       (/ 1.0 (fabs (/ 1.0 (* ew (fma eh (/ (* (cos t) t_1) ew) (sin t))))))
       t_2))))
double code(double eh, double ew, double t) {
	double t_1 = sin(atan((eh / (ew * tan(t)))));
	double t_2 = fabs((eh * (ew * fma(cos(t), (t_1 / ew), (cos(atan((eh / (ew * t)))) * (sin(t) / eh))))));
	double tmp;
	if (eh <= -1.52e-12) {
		tmp = t_2;
	} else if (eh <= 1.85e-91) {
		tmp = 1.0 / fabs((1.0 / (ew * fma(eh, ((cos(t) * t_1) / ew), sin(t)))));
	} else {
		tmp = t_2;
	}
	return tmp;
}
function code(eh, ew, t)
	t_1 = sin(atan(Float64(eh / Float64(ew * tan(t)))))
	t_2 = abs(Float64(eh * Float64(ew * fma(cos(t), Float64(t_1 / ew), Float64(cos(atan(Float64(eh / Float64(ew * t)))) * Float64(sin(t) / eh))))))
	tmp = 0.0
	if (eh <= -1.52e-12)
		tmp = t_2;
	elseif (eh <= 1.85e-91)
		tmp = Float64(1.0 / abs(Float64(1.0 / Float64(ew * fma(eh, Float64(Float64(cos(t) * t_1) / ew), sin(t))))));
	else
		tmp = t_2;
	end
	return tmp
end
code[eh_, ew_, t_] := Block[{t$95$1 = N[Sin[N[ArcTan[N[(eh / N[(ew * N[Tan[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Abs[N[(eh * N[(ew * N[(N[Cos[t], $MachinePrecision] * N[(t$95$1 / ew), $MachinePrecision] + N[(N[Cos[N[ArcTan[N[(eh / N[(ew * t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * N[(N[Sin[t], $MachinePrecision] / eh), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[eh, -1.52e-12], t$95$2, If[LessEqual[eh, 1.85e-91], N[(1.0 / N[Abs[N[(1.0 / N[(ew * N[(eh * N[(N[(N[Cos[t], $MachinePrecision] * t$95$1), $MachinePrecision] / ew), $MachinePrecision] + N[Sin[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], t$95$2]]]]
\begin{array}{l}

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

\mathbf{elif}\;eh \leq 1.85 \cdot 10^{-91}:\\
\;\;\;\;\frac{1}{\left|\frac{1}{ew \cdot \mathsf{fma}\left(eh, \frac{\cos t \cdot t\_1}{ew}, \sin t\right)}\right|}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if eh < -1.52e-12 or 1.8500000000000001e-91 < eh

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left|eh \cdot \left(ew \cdot \mathsf{fma}\left(\cos t, \frac{\sin \tan^{-1} \left(\frac{eh}{ew \cdot \tan t}\right)}{ew}, \cos \tan^{-1} \left(\frac{eh}{ew \cdot t}\right) \cdot \frac{\sin t}{eh}\right)\right)\right| \]
      3. Step-by-step derivation
        1. Applied rewrites99.6%

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

        if -1.52e-12 < eh < 1.8500000000000001e-91

        1. Initial program 99.8%

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

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

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

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

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

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

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

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

        \[\leadsto \begin{array}{l} \mathbf{if}\;eh \leq -1.52 \cdot 10^{-12}:\\ \;\;\;\;\left|eh \cdot \left(ew \cdot \mathsf{fma}\left(\cos t, \frac{\sin \tan^{-1} \left(\frac{eh}{ew \cdot \tan t}\right)}{ew}, \cos \tan^{-1} \left(\frac{eh}{ew \cdot t}\right) \cdot \frac{\sin t}{eh}\right)\right)\right|\\ \mathbf{elif}\;eh \leq 1.85 \cdot 10^{-91}:\\ \;\;\;\;\frac{1}{\left|\frac{1}{ew \cdot \mathsf{fma}\left(eh, \frac{\cos t \cdot \sin \tan^{-1} \left(\frac{eh}{ew \cdot \tan t}\right)}{ew}, \sin t\right)}\right|}\\ \mathbf{else}:\\ \;\;\;\;\left|eh \cdot \left(ew \cdot \mathsf{fma}\left(\cos t, \frac{\sin \tan^{-1} \left(\frac{eh}{ew \cdot \tan t}\right)}{ew}, \cos \tan^{-1} \left(\frac{eh}{ew \cdot t}\right) \cdot \frac{\sin t}{eh}\right)\right)\right|\\ \end{array} \]
      6. Add Preprocessing

      Alternative 4: 93.1% accurate, 1.5× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{1}{\left|\frac{1}{ew \cdot \mathsf{fma}\left(eh, \frac{\cos t \cdot \sin \tan^{-1} \left(\frac{eh}{ew \cdot \tan t}\right)}{ew}, \sin t\right)}\right|}\\ \mathbf{if}\;ew \leq -4.2 \cdot 10^{-45}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;ew \leq 6.6 \cdot 10^{-110}:\\ \;\;\;\;\left|eh \cdot \cos t\right|\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
      (FPCore (eh ew t)
       :precision binary64
       (let* ((t_1
               (/
                1.0
                (fabs
                 (/
                  1.0
                  (*
                   ew
                   (fma
                    eh
                    (/ (* (cos t) (sin (atan (/ eh (* ew (tan t)))))) ew)
                    (sin t))))))))
         (if (<= ew -4.2e-45) t_1 (if (<= ew 6.6e-110) (fabs (* eh (cos t))) t_1))))
      double code(double eh, double ew, double t) {
      	double t_1 = 1.0 / fabs((1.0 / (ew * fma(eh, ((cos(t) * sin(atan((eh / (ew * tan(t)))))) / ew), sin(t)))));
      	double tmp;
      	if (ew <= -4.2e-45) {
      		tmp = t_1;
      	} else if (ew <= 6.6e-110) {
      		tmp = fabs((eh * cos(t)));
      	} else {
      		tmp = t_1;
      	}
      	return tmp;
      }
      
      function code(eh, ew, t)
      	t_1 = Float64(1.0 / abs(Float64(1.0 / Float64(ew * fma(eh, Float64(Float64(cos(t) * sin(atan(Float64(eh / Float64(ew * tan(t)))))) / ew), sin(t))))))
      	tmp = 0.0
      	if (ew <= -4.2e-45)
      		tmp = t_1;
      	elseif (ew <= 6.6e-110)
      		tmp = abs(Float64(eh * cos(t)));
      	else
      		tmp = t_1;
      	end
      	return tmp
      end
      
      code[eh_, ew_, t_] := Block[{t$95$1 = N[(1.0 / N[Abs[N[(1.0 / N[(ew * N[(eh * N[(N[(N[Cos[t], $MachinePrecision] * N[Sin[N[ArcTan[N[(eh / N[(ew * N[Tan[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / ew), $MachinePrecision] + N[Sin[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[ew, -4.2e-45], t$95$1, If[LessEqual[ew, 6.6e-110], N[Abs[N[(eh * N[Cos[t], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], t$95$1]]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      t_1 := \frac{1}{\left|\frac{1}{ew \cdot \mathsf{fma}\left(eh, \frac{\cos t \cdot \sin \tan^{-1} \left(\frac{eh}{ew \cdot \tan t}\right)}{ew}, \sin t\right)}\right|}\\
      \mathbf{if}\;ew \leq -4.2 \cdot 10^{-45}:\\
      \;\;\;\;t\_1\\
      
      \mathbf{elif}\;ew \leq 6.6 \cdot 10^{-110}:\\
      \;\;\;\;\left|eh \cdot \cos t\right|\\
      
      \mathbf{else}:\\
      \;\;\;\;t\_1\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if ew < -4.1999999999999999e-45 or 6.5999999999999998e-110 < ew

        1. Initial program 99.8%

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

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

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

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

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

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

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

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

        if -4.1999999999999999e-45 < ew < 6.5999999999999998e-110

        1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

            \[\leadsto \left|\color{blue}{eh \cdot \cos t}\right| \]
          2. lower-cos.f6492.2

            \[\leadsto \left|eh \cdot \color{blue}{\cos t}\right| \]
        7. Applied rewrites92.2%

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

      Alternative 5: 84.2% accurate, 1.7× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} t_1 := ew \cdot \sin t\\ t_2 := eh \cdot \cos t\\ t_3 := \left|t\_2\right|\\ t_4 := \left|\mathsf{fma}\left(t\_2 \cdot \frac{eh}{ew}, \frac{1}{\frac{eh}{ew}}, \frac{t\_1}{\sqrt{\mathsf{fma}\left(eh \cdot eh, {\left(ew \cdot \tan t\right)}^{-2}, 1\right)}}\right)\right|\\ \mathbf{if}\;eh \leq -9 \cdot 10^{+64}:\\ \;\;\;\;t\_3\\ \mathbf{elif}\;eh \leq -2.55 \cdot 10^{-160}:\\ \;\;\;\;t\_4\\ \mathbf{elif}\;eh \leq 2.3 \cdot 10^{-136}:\\ \;\;\;\;\left|t\_1\right|\\ \mathbf{elif}\;eh \leq 1.75 \cdot 10^{+34}:\\ \;\;\;\;t\_4\\ \mathbf{else}:\\ \;\;\;\;t\_3\\ \end{array} \end{array} \]
      (FPCore (eh ew t)
       :precision binary64
       (let* ((t_1 (* ew (sin t)))
              (t_2 (* eh (cos t)))
              (t_3 (fabs t_2))
              (t_4
               (fabs
                (fma
                 (* t_2 (/ eh ew))
                 (/ 1.0 (/ eh ew))
                 (/ t_1 (sqrt (fma (* eh eh) (pow (* ew (tan t)) -2.0) 1.0)))))))
         (if (<= eh -9e+64)
           t_3
           (if (<= eh -2.55e-160)
             t_4
             (if (<= eh 2.3e-136) (fabs t_1) (if (<= eh 1.75e+34) t_4 t_3))))))
      double code(double eh, double ew, double t) {
      	double t_1 = ew * sin(t);
      	double t_2 = eh * cos(t);
      	double t_3 = fabs(t_2);
      	double t_4 = fabs(fma((t_2 * (eh / ew)), (1.0 / (eh / ew)), (t_1 / sqrt(fma((eh * eh), pow((ew * tan(t)), -2.0), 1.0)))));
      	double tmp;
      	if (eh <= -9e+64) {
      		tmp = t_3;
      	} else if (eh <= -2.55e-160) {
      		tmp = t_4;
      	} else if (eh <= 2.3e-136) {
      		tmp = fabs(t_1);
      	} else if (eh <= 1.75e+34) {
      		tmp = t_4;
      	} else {
      		tmp = t_3;
      	}
      	return tmp;
      }
      
      function code(eh, ew, t)
      	t_1 = Float64(ew * sin(t))
      	t_2 = Float64(eh * cos(t))
      	t_3 = abs(t_2)
      	t_4 = abs(fma(Float64(t_2 * Float64(eh / ew)), Float64(1.0 / Float64(eh / ew)), Float64(t_1 / sqrt(fma(Float64(eh * eh), (Float64(ew * tan(t)) ^ -2.0), 1.0)))))
      	tmp = 0.0
      	if (eh <= -9e+64)
      		tmp = t_3;
      	elseif (eh <= -2.55e-160)
      		tmp = t_4;
      	elseif (eh <= 2.3e-136)
      		tmp = abs(t_1);
      	elseif (eh <= 1.75e+34)
      		tmp = t_4;
      	else
      		tmp = t_3;
      	end
      	return tmp
      end
      
      code[eh_, ew_, t_] := Block[{t$95$1 = N[(ew * N[Sin[t], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(eh * N[Cos[t], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[Abs[t$95$2], $MachinePrecision]}, Block[{t$95$4 = N[Abs[N[(N[(t$95$2 * N[(eh / ew), $MachinePrecision]), $MachinePrecision] * N[(1.0 / N[(eh / ew), $MachinePrecision]), $MachinePrecision] + N[(t$95$1 / N[Sqrt[N[(N[(eh * eh), $MachinePrecision] * N[Power[N[(ew * N[Tan[t], $MachinePrecision]), $MachinePrecision], -2.0], $MachinePrecision] + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[eh, -9e+64], t$95$3, If[LessEqual[eh, -2.55e-160], t$95$4, If[LessEqual[eh, 2.3e-136], N[Abs[t$95$1], $MachinePrecision], If[LessEqual[eh, 1.75e+34], t$95$4, t$95$3]]]]]]]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      t_1 := ew \cdot \sin t\\
      t_2 := eh \cdot \cos t\\
      t_3 := \left|t\_2\right|\\
      t_4 := \left|\mathsf{fma}\left(t\_2 \cdot \frac{eh}{ew}, \frac{1}{\frac{eh}{ew}}, \frac{t\_1}{\sqrt{\mathsf{fma}\left(eh \cdot eh, {\left(ew \cdot \tan t\right)}^{-2}, 1\right)}}\right)\right|\\
      \mathbf{if}\;eh \leq -9 \cdot 10^{+64}:\\
      \;\;\;\;t\_3\\
      
      \mathbf{elif}\;eh \leq -2.55 \cdot 10^{-160}:\\
      \;\;\;\;t\_4\\
      
      \mathbf{elif}\;eh \leq 2.3 \cdot 10^{-136}:\\
      \;\;\;\;\left|t\_1\right|\\
      
      \mathbf{elif}\;eh \leq 1.75 \cdot 10^{+34}:\\
      \;\;\;\;t\_4\\
      
      \mathbf{else}:\\
      \;\;\;\;t\_3\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 3 regimes
      2. if eh < -8.99999999999999946e64 or 1.74999999999999999e34 < eh

        1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

            \[\leadsto \left|\color{blue}{eh \cdot \cos t}\right| \]
          2. lower-cos.f6486.6

            \[\leadsto \left|eh \cdot \color{blue}{\cos t}\right| \]
        7. Applied rewrites86.6%

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

        if -8.99999999999999946e64 < eh < -2.55e-160 or 2.29999999999999998e-136 < eh < 1.74999999999999999e34

        1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \left|\mathsf{fma}\left(\left(eh \cdot \cos t\right) \cdot \frac{eh}{ew}, \frac{1}{\color{blue}{\frac{eh}{ew}}}, \frac{ew \cdot \sin t}{\sqrt{\mathsf{fma}\left(eh \cdot eh, {\left(ew \cdot \tan t\right)}^{-2}, 1\right)}}\right)\right| \]
        6. Step-by-step derivation
          1. lower-/.f6489.2

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

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

        if -2.55e-160 < eh < 2.29999999999999998e-136

        1. Initial program 99.8%

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

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

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

            \[\leadsto \left|\color{blue}{ew \cdot \sin t}\right| \]
          2. lower-sin.f6474.6

            \[\leadsto \left|ew \cdot \color{blue}{\sin t}\right| \]
        6. Applied rewrites74.6%

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

      Alternative 6: 74.8% accurate, 7.2× speedup?

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

        1. Initial program 99.8%

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

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

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

            \[\leadsto \left|\color{blue}{ew \cdot \sin t}\right| \]
          2. lower-sin.f6469.7

            \[\leadsto \left|ew \cdot \color{blue}{\sin t}\right| \]
        6. Applied rewrites69.7%

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

        if -6.79999999999999967e25 < ew < 3.3999999999999999e39

        1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

            \[\leadsto \left|\color{blue}{eh \cdot \cos t}\right| \]
          2. lower-cos.f6485.0

            \[\leadsto \left|eh \cdot \color{blue}{\cos t}\right| \]
        7. Applied rewrites85.0%

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

      Alternative 7: 64.3% accurate, 7.2× speedup?

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

        1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            \[\leadsto \left|eh \cdot \color{blue}{\cos t}\right| \]
        7. Applied rewrites72.4%

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

        if -2.0500000000000001e-181 < eh < 2.9000000000000001e-147

        1. Initial program 99.8%

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

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

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

            \[\leadsto \left|\color{blue}{ew \cdot \sin t}\right| \]
          2. lower-sin.f6478.8

            \[\leadsto \left|ew \cdot \color{blue}{\sin t}\right| \]
        6. Applied rewrites78.8%

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

          \[\leadsto \left|ew \cdot \color{blue}{t}\right| \]
        8. Step-by-step derivation
          1. Applied rewrites48.2%

            \[\leadsto \left|t \cdot \color{blue}{ew}\right| \]
        9. Recombined 2 regimes into one program.
        10. Final simplification67.5%

          \[\leadsto \begin{array}{l} \mathbf{if}\;eh \leq -2.05 \cdot 10^{-181}:\\ \;\;\;\;\left|eh \cdot \cos t\right|\\ \mathbf{elif}\;eh \leq 2.9 \cdot 10^{-147}:\\ \;\;\;\;\left|ew \cdot t\right|\\ \mathbf{else}:\\ \;\;\;\;\left|eh \cdot \cos t\right|\\ \end{array} \]
        11. Add Preprocessing

        Alternative 8: 45.8% accurate, 43.4× speedup?

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

          1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

              \[\leadsto \left|eh \cdot \color{blue}{\cos t}\right| \]
          7. Applied rewrites73.3%

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

            \[\leadsto \left|eh \cdot 1\right| \]
          9. Step-by-step derivation
            1. Applied rewrites49.7%

              \[\leadsto \left|eh \cdot 1\right| \]

            if -1.22e-170 < eh < 3.39999999999999996e-147

            1. Initial program 99.8%

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

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

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

                \[\leadsto \left|\color{blue}{ew \cdot \sin t}\right| \]
              2. lower-sin.f6478.6

                \[\leadsto \left|ew \cdot \color{blue}{\sin t}\right| \]
            6. Applied rewrites78.6%

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

              \[\leadsto \left|ew \cdot \color{blue}{t}\right| \]
            8. Step-by-step derivation
              1. Applied rewrites46.9%

                \[\leadsto \left|t \cdot \color{blue}{ew}\right| \]
            9. Recombined 2 regimes into one program.
            10. Final simplification49.1%

              \[\leadsto \begin{array}{l} \mathbf{if}\;eh \leq -1.22 \cdot 10^{-170}:\\ \;\;\;\;\left|eh \cdot 1\right|\\ \mathbf{elif}\;eh \leq 3.4 \cdot 10^{-147}:\\ \;\;\;\;\left|ew \cdot t\right|\\ \mathbf{else}:\\ \;\;\;\;\left|eh \cdot 1\right|\\ \end{array} \]
            11. Add Preprocessing

            Alternative 9: 43.0% accurate, 108.8× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                \[\leadsto \left|\color{blue}{eh \cdot \cos t}\right| \]
              2. lower-cos.f6462.8

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

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

              \[\leadsto \left|eh \cdot 1\right| \]
            9. Step-by-step derivation
              1. Applied rewrites43.2%

                \[\leadsto \left|eh \cdot 1\right| \]
              2. Add Preprocessing

              Reproduce

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