Example from Robby

Percentage Accurate: 99.8% → 99.8%
Time: 19.0s
Alternatives: 15
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 15 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: 98.9% accurate, 1.1× speedup?

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

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

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

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

      \[\leadsto \left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \color{blue}{\left(\frac{eh}{ew \cdot 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|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{eh}{\color{blue}{t \cdot ew}}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
    3. lower-*.f6499.2

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

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

Alternative 3: 98.4% accurate, 1.6× speedup?

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

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

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

      \[\leadsto \left|\left(ew \cdot \color{blue}{\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. 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| \]
    3. lift-tan.f64N/A

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

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

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

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

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

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

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

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

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

    \[\leadsto \left|\color{blue}{eh \cdot \left(\cos t \cdot \sin \tan^{-1} \left(\frac{eh}{ew \cdot \tan t}\right)\right) + ew \cdot \sin t}\right| \]
  6. 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 \sin t\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 \sin t\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 \sin t\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 \sin t\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 \sin t\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 \sin t\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 \sin t\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 \sin t\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 \sin t\right)\right| \]
    10. 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}{ew \cdot \sin t}\right)\right| \]
    11. lower-sin.f6498.8

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

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

Alternative 4: 98.4% accurate, 1.6× speedup?

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

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

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

      \[\leadsto \left|\left(ew \cdot \color{blue}{\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. 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| \]
    3. lift-tan.f64N/A

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

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

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

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

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

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

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

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

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

    \[\leadsto \left|\color{blue}{eh \cdot \left(\cos t \cdot \sin \tan^{-1} \left(\frac{eh}{ew \cdot \tan t}\right)\right) + ew \cdot \sin t}\right| \]
  6. 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 \sin t\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 \sin t\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 \sin t\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 \sin t\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 \sin t\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 \sin t\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 \sin t\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 \sin t\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 \sin t\right)\right| \]
    10. 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}{ew \cdot \sin t}\right)\right| \]
    11. lower-sin.f6498.8

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 93.1% accurate, 1.8× speedup?

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

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

\mathbf{elif}\;eh \leq 6.5 \cdot 10^{+159}:\\
\;\;\;\;\left|ew \cdot \mathsf{fma}\left(eh, \frac{\cos t \cdot \sin \tan^{-1} \left(\frac{\mathsf{fma}\left(-0.3333333333333333, \frac{eh \cdot \left(t \cdot t\right)}{ew}, \frac{eh}{ew}\right)}{t}\right)}{ew}, \sin t\right)\right|\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if eh < -4.1e43 or 6.5000000000000001e159 < eh

    1. Initial program 99.7%

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

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

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

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

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

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

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

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

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

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

    if -4.1e43 < eh < 6.5000000000000001e159

    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-sin.f64N/A

        \[\leadsto \left|\left(ew \cdot \color{blue}{\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. 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| \]
      3. lift-tan.f64N/A

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

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

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

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

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

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

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

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

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

      \[\leadsto \left|\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| \]
    6. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto \left|\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 \left|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 \left|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 \left|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| \]
    7. Applied rewrites98.3%

      \[\leadsto \left|\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| \]
    8. Taylor expanded in t around 0

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

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

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

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

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

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

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

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

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

Alternative 6: 88.1% accurate, 1.9× speedup?

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

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

\mathbf{elif}\;eh \leq 3.05 \cdot 10^{+50}:\\
\;\;\;\;\left|ew \cdot \mathsf{fma}\left(eh, \frac{\cos t \cdot \sin \tan^{-1} \left(\frac{eh}{t \cdot ew}\right)}{ew}, \sin t\right)\right|\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if eh < -330 or 3.05000000000000013e50 < eh

    1. Initial program 99.7%

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

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

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

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

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

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

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

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

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

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

    if -330 < eh < 3.05000000000000013e50

    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-sin.f64N/A

        \[\leadsto \left|\left(ew \cdot \color{blue}{\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. 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| \]
      3. lift-tan.f64N/A

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

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

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

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

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

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

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

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

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

      \[\leadsto \left|\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| \]
    6. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto \left|\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 \left|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 \left|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 \left|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| \]
    7. Applied rewrites98.8%

      \[\leadsto \left|\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| \]
    8. Taylor expanded in t around 0

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

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

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

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

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

Alternative 7: 75.2% accurate, 2.0× speedup?

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

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

\mathbf{elif}\;eh \leq 2.5 \cdot 10^{-39}:\\
\;\;\;\;\left|ew \cdot \sin t\right|\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if eh < -6.20000000000000008e-54 or 2.4999999999999999e-39 < eh

    1. Initial program 99.7%

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

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

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

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

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

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

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

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

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

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

    if -6.20000000000000008e-54 < eh < 2.4999999999999999e-39

    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-sin.f64N/A

        \[\leadsto \left|\left(ew \cdot \color{blue}{\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. 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| \]
      3. lift-tan.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 8: 69.2% accurate, 3.4× speedup?

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

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

\mathbf{elif}\;t \leq 0.00092:\\
\;\;\;\;\left|ew \cdot \mathsf{fma}\left(eh, \frac{\sin \tan^{-1} \left(\frac{eh}{t \cdot ew}\right)}{ew}, t\right)\right|\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -0.115000000000000005 or 9.2000000000000003e-4 < 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. Step-by-step derivation
      1. lift-sin.f64N/A

        \[\leadsto \left|\left(ew \cdot \color{blue}{\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. 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| \]
      3. lift-tan.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -0.115000000000000005 < t < 9.2000000000000003e-4

    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. Step-by-step derivation
      1. lift-sin.f64N/A

        \[\leadsto \left|\left(ew \cdot \color{blue}{\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. 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| \]
      3. lift-tan.f64N/A

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

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

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

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

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

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

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

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

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

      \[\leadsto \left|\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| \]
    6. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto \left|\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 \left|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 \left|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 \left|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| \]
    7. Applied rewrites85.6%

      \[\leadsto \left|\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| \]
    8. Taylor expanded in t around 0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 9: 59.6% accurate, 7.2× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;eh \leq -6.2 \cdot 10^{-54}:\\
\;\;\;\;\left|eh\right|\\

\mathbf{elif}\;eh \leq 2.5 \cdot 10^{-38}:\\
\;\;\;\;\left|ew \cdot \sin t\right|\\

\mathbf{else}:\\
\;\;\;\;\left|eh\right|\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if eh < -6.20000000000000008e-54 or 2.50000000000000017e-38 < eh

    1. Initial program 99.7%

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

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

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

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

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

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

        \[\leadsto \left|eh \cdot \sin \tan^{-1} \left(\frac{eh}{\color{blue}{ew \cdot \tan t}}\right)\right| \]
      6. lower-tan.f6453.9

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left|eh \cdot \color{blue}{\frac{\frac{eh}{ew \cdot \tan t}}{\sqrt{1 + \frac{eh}{ew \cdot \tan t} \cdot \frac{eh}{ew \cdot \tan t}}}}\right| \]
      11. lift-/.f64N/A

        \[\leadsto \left|eh \cdot \frac{\frac{eh}{ew \cdot \tan t}}{\sqrt{1 + \color{blue}{\frac{eh}{ew \cdot \tan t}} \cdot \frac{eh}{ew \cdot \tan t}}}\right| \]
      12. div-invN/A

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

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

        \[\leadsto \left|eh \cdot \frac{\frac{eh}{ew \cdot \tan t}}{\sqrt{1 + \left(eh \cdot \frac{1}{ew \cdot \tan t}\right) \cdot \color{blue}{\left(eh \cdot \frac{1}{ew \cdot \tan t}\right)}}}\right| \]
    7. Applied rewrites9.0%

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

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

        \[\leadsto \left|\color{blue}{\mathsf{neg}\left(eh\right)}\right| \]
      2. lower-neg.f6454.2

        \[\leadsto \left|\color{blue}{-eh}\right| \]
    10. Applied rewrites54.2%

      \[\leadsto \left|\color{blue}{-eh}\right| \]
    11. Step-by-step derivation
      1. fabs-negN/A

        \[\leadsto \color{blue}{\left|eh\right|} \]
      2. lower-fabs.f6454.2

        \[\leadsto \color{blue}{\left|eh\right|} \]
    12. Applied rewrites54.2%

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

    if -6.20000000000000008e-54 < eh < 2.50000000000000017e-38

    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-sin.f64N/A

        \[\leadsto \left|\left(ew \cdot \color{blue}{\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. 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| \]
      3. lift-tan.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 10: 45.3% accurate, 16.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;ew \leq -2 \cdot 10^{+115}:\\ \;\;\;\;\left|ew \cdot \left(t \cdot \mathsf{fma}\left(t \cdot t, \mathsf{fma}\left(t \cdot t, \mathsf{fma}\left(t \cdot t, -0.0001984126984126984, 0.008333333333333333\right), -0.16666666666666666\right), 1\right)\right)\right|\\ \mathbf{elif}\;ew \leq 4 \cdot 10^{+218}:\\ \;\;\;\;\left|eh\right|\\ \mathbf{else}:\\ \;\;\;\;\left|t \cdot ew\right|\\ \end{array} \end{array} \]
(FPCore (eh ew t)
 :precision binary64
 (if (<= ew -2e+115)
   (fabs
    (*
     ew
     (*
      t
      (fma
       (* t t)
       (fma
        (* t t)
        (fma (* t t) -0.0001984126984126984 0.008333333333333333)
        -0.16666666666666666)
       1.0))))
   (if (<= ew 4e+218) (fabs eh) (fabs (* t ew)))))
double code(double eh, double ew, double t) {
	double tmp;
	if (ew <= -2e+115) {
		tmp = fabs((ew * (t * fma((t * t), fma((t * t), fma((t * t), -0.0001984126984126984, 0.008333333333333333), -0.16666666666666666), 1.0))));
	} else if (ew <= 4e+218) {
		tmp = fabs(eh);
	} else {
		tmp = fabs((t * ew));
	}
	return tmp;
}
function code(eh, ew, t)
	tmp = 0.0
	if (ew <= -2e+115)
		tmp = abs(Float64(ew * Float64(t * fma(Float64(t * t), fma(Float64(t * t), fma(Float64(t * t), -0.0001984126984126984, 0.008333333333333333), -0.16666666666666666), 1.0))));
	elseif (ew <= 4e+218)
		tmp = abs(eh);
	else
		tmp = abs(Float64(t * ew));
	end
	return tmp
end
code[eh_, ew_, t_] := If[LessEqual[ew, -2e+115], N[Abs[N[(ew * N[(t * N[(N[(t * t), $MachinePrecision] * N[(N[(t * t), $MachinePrecision] * N[(N[(t * t), $MachinePrecision] * -0.0001984126984126984 + 0.008333333333333333), $MachinePrecision] + -0.16666666666666666), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[ew, 4e+218], N[Abs[eh], $MachinePrecision], N[Abs[N[(t * ew), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;ew \leq -2 \cdot 10^{+115}:\\
\;\;\;\;\left|ew \cdot \left(t \cdot \mathsf{fma}\left(t \cdot t, \mathsf{fma}\left(t \cdot t, \mathsf{fma}\left(t \cdot t, -0.0001984126984126984, 0.008333333333333333\right), -0.16666666666666666\right), 1\right)\right)\right|\\

\mathbf{elif}\;ew \leq 4 \cdot 10^{+218}:\\
\;\;\;\;\left|eh\right|\\

\mathbf{else}:\\
\;\;\;\;\left|t \cdot ew\right|\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if ew < -2e115

    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-sin.f64N/A

        \[\leadsto \left|\left(ew \cdot \color{blue}{\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. 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| \]
      3. lift-tan.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \left|ew \cdot \color{blue}{\left(t \cdot \left(1 + {t}^{2} \cdot \left({t}^{2} \cdot \left(\frac{1}{120} + \frac{-1}{5040} \cdot {t}^{2}\right) - \frac{1}{6}\right)\right)\right)}\right| \]
    9. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto \left|ew \cdot \color{blue}{\left(t \cdot \left(1 + {t}^{2} \cdot \left({t}^{2} \cdot \left(\frac{1}{120} + \frac{-1}{5040} \cdot {t}^{2}\right) - \frac{1}{6}\right)\right)\right)}\right| \]
      2. +-commutativeN/A

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

        \[\leadsto \left|ew \cdot \left(t \cdot \color{blue}{\mathsf{fma}\left({t}^{2}, {t}^{2} \cdot \left(\frac{1}{120} + \frac{-1}{5040} \cdot {t}^{2}\right) - \frac{1}{6}, 1\right)}\right)\right| \]
      4. unpow2N/A

        \[\leadsto \left|ew \cdot \left(t \cdot \mathsf{fma}\left(\color{blue}{t \cdot t}, {t}^{2} \cdot \left(\frac{1}{120} + \frac{-1}{5040} \cdot {t}^{2}\right) - \frac{1}{6}, 1\right)\right)\right| \]
      5. lower-*.f64N/A

        \[\leadsto \left|ew \cdot \left(t \cdot \mathsf{fma}\left(\color{blue}{t \cdot t}, {t}^{2} \cdot \left(\frac{1}{120} + \frac{-1}{5040} \cdot {t}^{2}\right) - \frac{1}{6}, 1\right)\right)\right| \]
      6. sub-negN/A

        \[\leadsto \left|ew \cdot \left(t \cdot \mathsf{fma}\left(t \cdot t, \color{blue}{{t}^{2} \cdot \left(\frac{1}{120} + \frac{-1}{5040} \cdot {t}^{2}\right) + \left(\mathsf{neg}\left(\frac{1}{6}\right)\right)}, 1\right)\right)\right| \]
      7. metadata-evalN/A

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

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

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

        \[\leadsto \left|ew \cdot \left(t \cdot \mathsf{fma}\left(t \cdot t, \mathsf{fma}\left(\color{blue}{t \cdot t}, \frac{1}{120} + \frac{-1}{5040} \cdot {t}^{2}, \frac{-1}{6}\right), 1\right)\right)\right| \]
      11. +-commutativeN/A

        \[\leadsto \left|ew \cdot \left(t \cdot \mathsf{fma}\left(t \cdot t, \mathsf{fma}\left(t \cdot t, \color{blue}{\frac{-1}{5040} \cdot {t}^{2} + \frac{1}{120}}, \frac{-1}{6}\right), 1\right)\right)\right| \]
      12. *-commutativeN/A

        \[\leadsto \left|ew \cdot \left(t \cdot \mathsf{fma}\left(t \cdot t, \mathsf{fma}\left(t \cdot t, \color{blue}{{t}^{2} \cdot \frac{-1}{5040}} + \frac{1}{120}, \frac{-1}{6}\right), 1\right)\right)\right| \]
      13. lower-fma.f64N/A

        \[\leadsto \left|ew \cdot \left(t \cdot \mathsf{fma}\left(t \cdot t, \mathsf{fma}\left(t \cdot t, \color{blue}{\mathsf{fma}\left({t}^{2}, \frac{-1}{5040}, \frac{1}{120}\right)}, \frac{-1}{6}\right), 1\right)\right)\right| \]
      14. unpow2N/A

        \[\leadsto \left|ew \cdot \left(t \cdot \mathsf{fma}\left(t \cdot t, \mathsf{fma}\left(t \cdot t, \mathsf{fma}\left(\color{blue}{t \cdot t}, \frac{-1}{5040}, \frac{1}{120}\right), \frac{-1}{6}\right), 1\right)\right)\right| \]
      15. lower-*.f6435.3

        \[\leadsto \left|ew \cdot \left(t \cdot \mathsf{fma}\left(t \cdot t, \mathsf{fma}\left(t \cdot t, \mathsf{fma}\left(\color{blue}{t \cdot t}, -0.0001984126984126984, 0.008333333333333333\right), -0.16666666666666666\right), 1\right)\right)\right| \]
    10. Applied rewrites35.3%

      \[\leadsto \left|ew \cdot \color{blue}{\left(t \cdot \mathsf{fma}\left(t \cdot t, \mathsf{fma}\left(t \cdot t, \mathsf{fma}\left(t \cdot t, -0.0001984126984126984, 0.008333333333333333\right), -0.16666666666666666\right), 1\right)\right)}\right| \]

    if -2e115 < ew < 4.00000000000000033e218

    1. Initial program 99.7%

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

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

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

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

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

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

        \[\leadsto \left|eh \cdot \sin \tan^{-1} \left(\frac{eh}{\color{blue}{ew \cdot \tan t}}\right)\right| \]
      6. lower-tan.f6450.0

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left|eh \cdot \color{blue}{\frac{\frac{eh}{ew \cdot \tan t}}{\sqrt{1 + \frac{eh}{ew \cdot \tan t} \cdot \frac{eh}{ew \cdot \tan t}}}}\right| \]
      11. lift-/.f64N/A

        \[\leadsto \left|eh \cdot \frac{\frac{eh}{ew \cdot \tan t}}{\sqrt{1 + \color{blue}{\frac{eh}{ew \cdot \tan t}} \cdot \frac{eh}{ew \cdot \tan t}}}\right| \]
      12. div-invN/A

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

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

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

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

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

        \[\leadsto \left|\color{blue}{\mathsf{neg}\left(eh\right)}\right| \]
      2. lower-neg.f6450.4

        \[\leadsto \left|\color{blue}{-eh}\right| \]
    10. Applied rewrites50.4%

      \[\leadsto \left|\color{blue}{-eh}\right| \]
    11. Step-by-step derivation
      1. fabs-negN/A

        \[\leadsto \color{blue}{\left|eh\right|} \]
      2. lower-fabs.f6450.4

        \[\leadsto \color{blue}{\left|eh\right|} \]
    12. Applied rewrites50.4%

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

    if 4.00000000000000033e218 < ew

    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. Step-by-step derivation
      1. lift-sin.f64N/A

        \[\leadsto \left|\left(ew \cdot \color{blue}{\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. 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| \]
      3. lift-tan.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left|\color{blue}{t \cdot ew}\right| \]
      2. lower-*.f6473.1

        \[\leadsto \left|\color{blue}{t \cdot ew}\right| \]
    10. Applied rewrites73.1%

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

Alternative 11: 45.3% accurate, 18.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;ew \leq -2 \cdot 10^{+115}:\\ \;\;\;\;\left|t \cdot \mathsf{fma}\left(t \cdot t, \mathsf{fma}\left(ew, -0.16666666666666666, 0.008333333333333333 \cdot \left(ew \cdot \left(t \cdot t\right)\right)\right), ew\right)\right|\\ \mathbf{elif}\;ew \leq 4 \cdot 10^{+218}:\\ \;\;\;\;\left|eh\right|\\ \mathbf{else}:\\ \;\;\;\;\left|t \cdot ew\right|\\ \end{array} \end{array} \]
(FPCore (eh ew t)
 :precision binary64
 (if (<= ew -2e+115)
   (fabs
    (*
     t
     (fma
      (* t t)
      (fma ew -0.16666666666666666 (* 0.008333333333333333 (* ew (* t t))))
      ew)))
   (if (<= ew 4e+218) (fabs eh) (fabs (* t ew)))))
double code(double eh, double ew, double t) {
	double tmp;
	if (ew <= -2e+115) {
		tmp = fabs((t * fma((t * t), fma(ew, -0.16666666666666666, (0.008333333333333333 * (ew * (t * t)))), ew)));
	} else if (ew <= 4e+218) {
		tmp = fabs(eh);
	} else {
		tmp = fabs((t * ew));
	}
	return tmp;
}
function code(eh, ew, t)
	tmp = 0.0
	if (ew <= -2e+115)
		tmp = abs(Float64(t * fma(Float64(t * t), fma(ew, -0.16666666666666666, Float64(0.008333333333333333 * Float64(ew * Float64(t * t)))), ew)));
	elseif (ew <= 4e+218)
		tmp = abs(eh);
	else
		tmp = abs(Float64(t * ew));
	end
	return tmp
end
code[eh_, ew_, t_] := If[LessEqual[ew, -2e+115], N[Abs[N[(t * N[(N[(t * t), $MachinePrecision] * N[(ew * -0.16666666666666666 + N[(0.008333333333333333 * N[(ew * N[(t * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + ew), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[ew, 4e+218], N[Abs[eh], $MachinePrecision], N[Abs[N[(t * ew), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;ew \leq -2 \cdot 10^{+115}:\\
\;\;\;\;\left|t \cdot \mathsf{fma}\left(t \cdot t, \mathsf{fma}\left(ew, -0.16666666666666666, 0.008333333333333333 \cdot \left(ew \cdot \left(t \cdot t\right)\right)\right), ew\right)\right|\\

\mathbf{elif}\;ew \leq 4 \cdot 10^{+218}:\\
\;\;\;\;\left|eh\right|\\

\mathbf{else}:\\
\;\;\;\;\left|t \cdot ew\right|\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if ew < -2e115

    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-sin.f64N/A

        \[\leadsto \left|\left(ew \cdot \color{blue}{\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. 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| \]
      3. lift-tan.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \left|\color{blue}{t \cdot \left(ew + {t}^{2} \cdot \left(\frac{-1}{6} \cdot ew + \frac{1}{120} \cdot \left(ew \cdot {t}^{2}\right)\right)\right)}\right| \]
    9. Step-by-step derivation
      1. lower-*.f64N/A

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

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

        \[\leadsto \left|t \cdot \color{blue}{\mathsf{fma}\left({t}^{2}, \frac{-1}{6} \cdot ew + \frac{1}{120} \cdot \left(ew \cdot {t}^{2}\right), ew\right)}\right| \]
      4. unpow2N/A

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

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

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

        \[\leadsto \left|t \cdot \mathsf{fma}\left(t \cdot t, \color{blue}{\mathsf{fma}\left(ew, \frac{-1}{6}, \frac{1}{120} \cdot \left(ew \cdot {t}^{2}\right)\right)}, ew\right)\right| \]
      8. *-commutativeN/A

        \[\leadsto \left|t \cdot \mathsf{fma}\left(t \cdot t, \mathsf{fma}\left(ew, \frac{-1}{6}, \color{blue}{\left(ew \cdot {t}^{2}\right) \cdot \frac{1}{120}}\right), ew\right)\right| \]
      9. lower-*.f64N/A

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

        \[\leadsto \left|t \cdot \mathsf{fma}\left(t \cdot t, \mathsf{fma}\left(ew, \frac{-1}{6}, \color{blue}{\left(ew \cdot {t}^{2}\right)} \cdot \frac{1}{120}\right), ew\right)\right| \]
      11. unpow2N/A

        \[\leadsto \left|t \cdot \mathsf{fma}\left(t \cdot t, \mathsf{fma}\left(ew, \frac{-1}{6}, \left(ew \cdot \color{blue}{\left(t \cdot t\right)}\right) \cdot \frac{1}{120}\right), ew\right)\right| \]
      12. lower-*.f6434.9

        \[\leadsto \left|t \cdot \mathsf{fma}\left(t \cdot t, \mathsf{fma}\left(ew, -0.16666666666666666, \left(ew \cdot \color{blue}{\left(t \cdot t\right)}\right) \cdot 0.008333333333333333\right), ew\right)\right| \]
    10. Applied rewrites34.9%

      \[\leadsto \left|\color{blue}{t \cdot \mathsf{fma}\left(t \cdot t, \mathsf{fma}\left(ew, -0.16666666666666666, \left(ew \cdot \left(t \cdot t\right)\right) \cdot 0.008333333333333333\right), ew\right)}\right| \]

    if -2e115 < ew < 4.00000000000000033e218

    1. Initial program 99.7%

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

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

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

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

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

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

        \[\leadsto \left|eh \cdot \sin \tan^{-1} \left(\frac{eh}{\color{blue}{ew \cdot \tan t}}\right)\right| \]
      6. lower-tan.f6450.0

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left|eh \cdot \color{blue}{\frac{\frac{eh}{ew \cdot \tan t}}{\sqrt{1 + \frac{eh}{ew \cdot \tan t} \cdot \frac{eh}{ew \cdot \tan t}}}}\right| \]
      11. lift-/.f64N/A

        \[\leadsto \left|eh \cdot \frac{\frac{eh}{ew \cdot \tan t}}{\sqrt{1 + \color{blue}{\frac{eh}{ew \cdot \tan t}} \cdot \frac{eh}{ew \cdot \tan t}}}\right| \]
      12. div-invN/A

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

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

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

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

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

        \[\leadsto \left|\color{blue}{\mathsf{neg}\left(eh\right)}\right| \]
      2. lower-neg.f6450.4

        \[\leadsto \left|\color{blue}{-eh}\right| \]
    10. Applied rewrites50.4%

      \[\leadsto \left|\color{blue}{-eh}\right| \]
    11. Step-by-step derivation
      1. fabs-negN/A

        \[\leadsto \color{blue}{\left|eh\right|} \]
      2. lower-fabs.f6450.4

        \[\leadsto \color{blue}{\left|eh\right|} \]
    12. Applied rewrites50.4%

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

    if 4.00000000000000033e218 < ew

    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. Step-by-step derivation
      1. lift-sin.f64N/A

        \[\leadsto \left|\left(ew \cdot \color{blue}{\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. 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| \]
      3. lift-tan.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left|\color{blue}{t \cdot ew}\right| \]
      2. lower-*.f6473.1

        \[\leadsto \left|\color{blue}{t \cdot ew}\right| \]
    10. Applied rewrites73.1%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;ew \leq -2 \cdot 10^{+115}:\\ \;\;\;\;\left|t \cdot \mathsf{fma}\left(t \cdot t, \mathsf{fma}\left(ew, -0.16666666666666666, 0.008333333333333333 \cdot \left(ew \cdot \left(t \cdot t\right)\right)\right), ew\right)\right|\\ \mathbf{elif}\;ew \leq 4 \cdot 10^{+218}:\\ \;\;\;\;\left|eh\right|\\ \mathbf{else}:\\ \;\;\;\;\left|t \cdot ew\right|\\ \end{array} \]
  5. Add Preprocessing

Alternative 12: 45.3% accurate, 21.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;ew \leq -2 \cdot 10^{+115}:\\ \;\;\;\;\left|ew \cdot \mathsf{fma}\left(t, \left(t \cdot t\right) \cdot \mathsf{fma}\left(t \cdot t, 0.008333333333333333, -0.16666666666666666\right), t\right)\right|\\ \mathbf{elif}\;ew \leq 4 \cdot 10^{+218}:\\ \;\;\;\;\left|eh\right|\\ \mathbf{else}:\\ \;\;\;\;\left|t \cdot ew\right|\\ \end{array} \end{array} \]
(FPCore (eh ew t)
 :precision binary64
 (if (<= ew -2e+115)
   (fabs
    (*
     ew
     (fma
      t
      (* (* t t) (fma (* t t) 0.008333333333333333 -0.16666666666666666))
      t)))
   (if (<= ew 4e+218) (fabs eh) (fabs (* t ew)))))
double code(double eh, double ew, double t) {
	double tmp;
	if (ew <= -2e+115) {
		tmp = fabs((ew * fma(t, ((t * t) * fma((t * t), 0.008333333333333333, -0.16666666666666666)), t)));
	} else if (ew <= 4e+218) {
		tmp = fabs(eh);
	} else {
		tmp = fabs((t * ew));
	}
	return tmp;
}
function code(eh, ew, t)
	tmp = 0.0
	if (ew <= -2e+115)
		tmp = abs(Float64(ew * fma(t, Float64(Float64(t * t) * fma(Float64(t * t), 0.008333333333333333, -0.16666666666666666)), t)));
	elseif (ew <= 4e+218)
		tmp = abs(eh);
	else
		tmp = abs(Float64(t * ew));
	end
	return tmp
end
code[eh_, ew_, t_] := If[LessEqual[ew, -2e+115], N[Abs[N[(ew * N[(t * N[(N[(t * t), $MachinePrecision] * N[(N[(t * t), $MachinePrecision] * 0.008333333333333333 + -0.16666666666666666), $MachinePrecision]), $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[ew, 4e+218], N[Abs[eh], $MachinePrecision], N[Abs[N[(t * ew), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;ew \leq -2 \cdot 10^{+115}:\\
\;\;\;\;\left|ew \cdot \mathsf{fma}\left(t, \left(t \cdot t\right) \cdot \mathsf{fma}\left(t \cdot t, 0.008333333333333333, -0.16666666666666666\right), t\right)\right|\\

\mathbf{elif}\;ew \leq 4 \cdot 10^{+218}:\\
\;\;\;\;\left|eh\right|\\

\mathbf{else}:\\
\;\;\;\;\left|t \cdot ew\right|\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if ew < -2e115

    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-sin.f64N/A

        \[\leadsto \left|\left(ew \cdot \color{blue}{\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. 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| \]
      3. lift-tan.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left|ew \cdot \left(t \cdot \color{blue}{\left({t}^{2} \cdot \left(\frac{1}{120} \cdot {t}^{2} - \frac{1}{6}\right) + 1\right)}\right)\right| \]
      2. distribute-lft-inN/A

        \[\leadsto \left|ew \cdot \color{blue}{\left(t \cdot \left({t}^{2} \cdot \left(\frac{1}{120} \cdot {t}^{2} - \frac{1}{6}\right)\right) + t \cdot 1\right)}\right| \]
      3. *-rgt-identityN/A

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

        \[\leadsto \left|ew \cdot \color{blue}{\mathsf{fma}\left(t, {t}^{2} \cdot \left(\frac{1}{120} \cdot {t}^{2} - \frac{1}{6}\right), t\right)}\right| \]
      5. lower-*.f64N/A

        \[\leadsto \left|ew \cdot \mathsf{fma}\left(t, \color{blue}{{t}^{2} \cdot \left(\frac{1}{120} \cdot {t}^{2} - \frac{1}{6}\right)}, t\right)\right| \]
      6. unpow2N/A

        \[\leadsto \left|ew \cdot \mathsf{fma}\left(t, \color{blue}{\left(t \cdot t\right)} \cdot \left(\frac{1}{120} \cdot {t}^{2} - \frac{1}{6}\right), t\right)\right| \]
      7. lower-*.f64N/A

        \[\leadsto \left|ew \cdot \mathsf{fma}\left(t, \color{blue}{\left(t \cdot t\right)} \cdot \left(\frac{1}{120} \cdot {t}^{2} - \frac{1}{6}\right), t\right)\right| \]
      8. sub-negN/A

        \[\leadsto \left|ew \cdot \mathsf{fma}\left(t, \left(t \cdot t\right) \cdot \color{blue}{\left(\frac{1}{120} \cdot {t}^{2} + \left(\mathsf{neg}\left(\frac{1}{6}\right)\right)\right)}, t\right)\right| \]
      9. *-commutativeN/A

        \[\leadsto \left|ew \cdot \mathsf{fma}\left(t, \left(t \cdot t\right) \cdot \left(\color{blue}{{t}^{2} \cdot \frac{1}{120}} + \left(\mathsf{neg}\left(\frac{1}{6}\right)\right)\right), t\right)\right| \]
      10. metadata-evalN/A

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

        \[\leadsto \left|ew \cdot \mathsf{fma}\left(t, \left(t \cdot t\right) \cdot \color{blue}{\mathsf{fma}\left({t}^{2}, \frac{1}{120}, \frac{-1}{6}\right)}, t\right)\right| \]
      12. unpow2N/A

        \[\leadsto \left|ew \cdot \mathsf{fma}\left(t, \left(t \cdot t\right) \cdot \mathsf{fma}\left(\color{blue}{t \cdot t}, \frac{1}{120}, \frac{-1}{6}\right), t\right)\right| \]
      13. lower-*.f6434.9

        \[\leadsto \left|ew \cdot \mathsf{fma}\left(t, \left(t \cdot t\right) \cdot \mathsf{fma}\left(\color{blue}{t \cdot t}, 0.008333333333333333, -0.16666666666666666\right), t\right)\right| \]
    10. Applied rewrites34.9%

      \[\leadsto \left|ew \cdot \color{blue}{\mathsf{fma}\left(t, \left(t \cdot t\right) \cdot \mathsf{fma}\left(t \cdot t, 0.008333333333333333, -0.16666666666666666\right), t\right)}\right| \]

    if -2e115 < ew < 4.00000000000000033e218

    1. Initial program 99.7%

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

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

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

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

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

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

        \[\leadsto \left|eh \cdot \sin \tan^{-1} \left(\frac{eh}{\color{blue}{ew \cdot \tan t}}\right)\right| \]
      6. lower-tan.f6450.0

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left|eh \cdot \color{blue}{\frac{\frac{eh}{ew \cdot \tan t}}{\sqrt{1 + \frac{eh}{ew \cdot \tan t} \cdot \frac{eh}{ew \cdot \tan t}}}}\right| \]
      11. lift-/.f64N/A

        \[\leadsto \left|eh \cdot \frac{\frac{eh}{ew \cdot \tan t}}{\sqrt{1 + \color{blue}{\frac{eh}{ew \cdot \tan t}} \cdot \frac{eh}{ew \cdot \tan t}}}\right| \]
      12. div-invN/A

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

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

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

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

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

        \[\leadsto \left|\color{blue}{\mathsf{neg}\left(eh\right)}\right| \]
      2. lower-neg.f6450.4

        \[\leadsto \left|\color{blue}{-eh}\right| \]
    10. Applied rewrites50.4%

      \[\leadsto \left|\color{blue}{-eh}\right| \]
    11. Step-by-step derivation
      1. fabs-negN/A

        \[\leadsto \color{blue}{\left|eh\right|} \]
      2. lower-fabs.f6450.4

        \[\leadsto \color{blue}{\left|eh\right|} \]
    12. Applied rewrites50.4%

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

    if 4.00000000000000033e218 < ew

    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. Step-by-step derivation
      1. lift-sin.f64N/A

        \[\leadsto \left|\left(ew \cdot \color{blue}{\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. 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| \]
      3. lift-tan.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left|\color{blue}{t \cdot ew}\right| \]
      2. lower-*.f6473.1

        \[\leadsto \left|\color{blue}{t \cdot ew}\right| \]
    10. Applied rewrites73.1%

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

Alternative 13: 45.3% accurate, 29.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;ew \leq -2 \cdot 10^{+115}:\\ \;\;\;\;\left|ew \cdot \mathsf{fma}\left(t, \left(t \cdot t\right) \cdot -0.16666666666666666, t\right)\right|\\ \mathbf{elif}\;ew \leq 4 \cdot 10^{+218}:\\ \;\;\;\;\left|eh\right|\\ \mathbf{else}:\\ \;\;\;\;\left|t \cdot ew\right|\\ \end{array} \end{array} \]
(FPCore (eh ew t)
 :precision binary64
 (if (<= ew -2e+115)
   (fabs (* ew (fma t (* (* t t) -0.16666666666666666) t)))
   (if (<= ew 4e+218) (fabs eh) (fabs (* t ew)))))
double code(double eh, double ew, double t) {
	double tmp;
	if (ew <= -2e+115) {
		tmp = fabs((ew * fma(t, ((t * t) * -0.16666666666666666), t)));
	} else if (ew <= 4e+218) {
		tmp = fabs(eh);
	} else {
		tmp = fabs((t * ew));
	}
	return tmp;
}
function code(eh, ew, t)
	tmp = 0.0
	if (ew <= -2e+115)
		tmp = abs(Float64(ew * fma(t, Float64(Float64(t * t) * -0.16666666666666666), t)));
	elseif (ew <= 4e+218)
		tmp = abs(eh);
	else
		tmp = abs(Float64(t * ew));
	end
	return tmp
end
code[eh_, ew_, t_] := If[LessEqual[ew, -2e+115], N[Abs[N[(ew * N[(t * N[(N[(t * t), $MachinePrecision] * -0.16666666666666666), $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[ew, 4e+218], N[Abs[eh], $MachinePrecision], N[Abs[N[(t * ew), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;ew \leq -2 \cdot 10^{+115}:\\
\;\;\;\;\left|ew \cdot \mathsf{fma}\left(t, \left(t \cdot t\right) \cdot -0.16666666666666666, t\right)\right|\\

\mathbf{elif}\;ew \leq 4 \cdot 10^{+218}:\\
\;\;\;\;\left|eh\right|\\

\mathbf{else}:\\
\;\;\;\;\left|t \cdot ew\right|\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if ew < -2e115

    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-sin.f64N/A

        \[\leadsto \left|\left(ew \cdot \color{blue}{\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. 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| \]
      3. lift-tan.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left|ew \cdot \left(t \cdot \color{blue}{\left(\frac{-1}{6} \cdot {t}^{2} + 1\right)}\right)\right| \]
      2. distribute-lft-inN/A

        \[\leadsto \left|ew \cdot \color{blue}{\left(t \cdot \left(\frac{-1}{6} \cdot {t}^{2}\right) + t \cdot 1\right)}\right| \]
      3. *-rgt-identityN/A

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

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

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

        \[\leadsto \left|ew \cdot \mathsf{fma}\left(t, \frac{-1}{6} \cdot \color{blue}{\left(t \cdot t\right)}, t\right)\right| \]
      7. lower-*.f6434.6

        \[\leadsto \left|ew \cdot \mathsf{fma}\left(t, -0.16666666666666666 \cdot \color{blue}{\left(t \cdot t\right)}, t\right)\right| \]
    10. Applied rewrites34.6%

      \[\leadsto \left|ew \cdot \color{blue}{\mathsf{fma}\left(t, -0.16666666666666666 \cdot \left(t \cdot t\right), t\right)}\right| \]

    if -2e115 < ew < 4.00000000000000033e218

    1. Initial program 99.7%

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

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

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

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

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

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

        \[\leadsto \left|eh \cdot \sin \tan^{-1} \left(\frac{eh}{\color{blue}{ew \cdot \tan t}}\right)\right| \]
      6. lower-tan.f6450.0

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left|eh \cdot \color{blue}{\frac{\frac{eh}{ew \cdot \tan t}}{\sqrt{1 + \frac{eh}{ew \cdot \tan t} \cdot \frac{eh}{ew \cdot \tan t}}}}\right| \]
      11. lift-/.f64N/A

        \[\leadsto \left|eh \cdot \frac{\frac{eh}{ew \cdot \tan t}}{\sqrt{1 + \color{blue}{\frac{eh}{ew \cdot \tan t}} \cdot \frac{eh}{ew \cdot \tan t}}}\right| \]
      12. div-invN/A

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

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

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

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

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

        \[\leadsto \left|\color{blue}{\mathsf{neg}\left(eh\right)}\right| \]
      2. lower-neg.f6450.4

        \[\leadsto \left|\color{blue}{-eh}\right| \]
    10. Applied rewrites50.4%

      \[\leadsto \left|\color{blue}{-eh}\right| \]
    11. Step-by-step derivation
      1. fabs-negN/A

        \[\leadsto \color{blue}{\left|eh\right|} \]
      2. lower-fabs.f6450.4

        \[\leadsto \color{blue}{\left|eh\right|} \]
    12. Applied rewrites50.4%

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

    if 4.00000000000000033e218 < ew

    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. Step-by-step derivation
      1. lift-sin.f64N/A

        \[\leadsto \left|\left(ew \cdot \color{blue}{\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. 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| \]
      3. lift-tan.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left|\color{blue}{t \cdot ew}\right| \]
      2. lower-*.f6473.1

        \[\leadsto \left|\color{blue}{t \cdot ew}\right| \]
    10. Applied rewrites73.1%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;ew \leq -2 \cdot 10^{+115}:\\ \;\;\;\;\left|ew \cdot \mathsf{fma}\left(t, \left(t \cdot t\right) \cdot -0.16666666666666666, t\right)\right|\\ \mathbf{elif}\;ew \leq 4 \cdot 10^{+218}:\\ \;\;\;\;\left|eh\right|\\ \mathbf{else}:\\ \;\;\;\;\left|t \cdot ew\right|\\ \end{array} \]
  5. Add Preprocessing

Alternative 14: 45.3% accurate, 43.4× speedup?

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

\\
\begin{array}{l}
t_1 := \left|t \cdot ew\right|\\
\mathbf{if}\;ew \leq -2 \cdot 10^{+115}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;ew \leq 4 \cdot 10^{+218}:\\
\;\;\;\;\left|eh\right|\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if ew < -2e115 or 4.00000000000000033e218 < ew

    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-sin.f64N/A

        \[\leadsto \left|\left(ew \cdot \color{blue}{\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. 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| \]
      3. lift-tan.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left|\color{blue}{t \cdot ew}\right| \]
      2. lower-*.f6442.5

        \[\leadsto \left|\color{blue}{t \cdot ew}\right| \]
    10. Applied rewrites42.5%

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

    if -2e115 < ew < 4.00000000000000033e218

    1. Initial program 99.7%

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

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

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

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

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

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

        \[\leadsto \left|eh \cdot \sin \tan^{-1} \left(\frac{eh}{\color{blue}{ew \cdot \tan t}}\right)\right| \]
      6. lower-tan.f6450.0

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left|eh \cdot \color{blue}{\frac{\frac{eh}{ew \cdot \tan t}}{\sqrt{1 + \frac{eh}{ew \cdot \tan t} \cdot \frac{eh}{ew \cdot \tan t}}}}\right| \]
      11. lift-/.f64N/A

        \[\leadsto \left|eh \cdot \frac{\frac{eh}{ew \cdot \tan t}}{\sqrt{1 + \color{blue}{\frac{eh}{ew \cdot \tan t}} \cdot \frac{eh}{ew \cdot \tan t}}}\right| \]
      12. div-invN/A

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

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

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

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

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

        \[\leadsto \left|\color{blue}{\mathsf{neg}\left(eh\right)}\right| \]
      2. lower-neg.f6450.4

        \[\leadsto \left|\color{blue}{-eh}\right| \]
    10. Applied rewrites50.4%

      \[\leadsto \left|\color{blue}{-eh}\right| \]
    11. Step-by-step derivation
      1. fabs-negN/A

        \[\leadsto \color{blue}{\left|eh\right|} \]
      2. lower-fabs.f6450.4

        \[\leadsto \color{blue}{\left|eh\right|} \]
    12. Applied rewrites50.4%

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

Alternative 15: 42.4% accurate, 290.0× speedup?

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

\\
\left|eh\right|
\end{array}
Derivation
  1. Initial program 99.8%

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

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

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

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

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

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

      \[\leadsto \left|eh \cdot \sin \tan^{-1} \left(\frac{eh}{\color{blue}{ew \cdot \tan t}}\right)\right| \]
    6. lower-tan.f6443.3

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \left|eh \cdot \color{blue}{\frac{\frac{eh}{ew \cdot \tan t}}{\sqrt{1 + \frac{eh}{ew \cdot \tan t} \cdot \frac{eh}{ew \cdot \tan t}}}}\right| \]
    11. lift-/.f64N/A

      \[\leadsto \left|eh \cdot \frac{\frac{eh}{ew \cdot \tan t}}{\sqrt{1 + \color{blue}{\frac{eh}{ew \cdot \tan t}} \cdot \frac{eh}{ew \cdot \tan t}}}\right| \]
    12. div-invN/A

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

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

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

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

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

      \[\leadsto \left|\color{blue}{\mathsf{neg}\left(eh\right)}\right| \]
    2. lower-neg.f6443.7

      \[\leadsto \left|\color{blue}{-eh}\right| \]
  10. Applied rewrites43.7%

    \[\leadsto \left|\color{blue}{-eh}\right| \]
  11. Step-by-step derivation
    1. fabs-negN/A

      \[\leadsto \color{blue}{\left|eh\right|} \]
    2. lower-fabs.f6443.7

      \[\leadsto \color{blue}{\left|eh\right|} \]
  12. Applied rewrites43.7%

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

Reproduce

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