Example from Robby

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

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

      \[\leadsto \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} \color{blue}{\left(\frac{\frac{eh}{ew}}{\tan t}\right)}\right| \]
    2. lift-/.f64N/A

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

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

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

      \[\leadsto \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{eh}{\color{blue}{\tan t \cdot ew}}\right)\right| \]
  4. Applied rewrites99.8%

    \[\leadsto \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} \color{blue}{\left(\frac{eh}{\tan t \cdot ew}\right)}\right| \]
  5. Final simplification99.8%

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

Alternative 2: 99.0% accurate, 1.1× speedup?

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

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

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

      \[\leadsto \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} \color{blue}{\left(\frac{\frac{eh}{ew}}{\tan t}\right)}\right| \]
    2. lift-/.f64N/A

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

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

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

      \[\leadsto \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{eh}{\color{blue}{\tan t \cdot ew}}\right)\right| \]
  4. Applied rewrites99.8%

    \[\leadsto \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} \color{blue}{\left(\frac{eh}{\tan t \cdot ew}\right)}\right| \]
  5. 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{eh}{\tan t \cdot ew}\right)\right| \]
  6. 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{eh}{\tan t \cdot ew}\right)\right| \]
    2. lower-*.f6499.4

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

    \[\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{eh}{\tan t \cdot ew}\right)\right| \]
  8. Final simplification99.4%

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

Alternative 3: 99.0% accurate, 1.5× speedup?

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

\\
\begin{array}{l}
t_1 := \frac{eh}{t \cdot ew}\\
\left|\mathsf{fma}\left(\frac{1}{\sqrt{\mathsf{fma}\left(t\_1, t\_1, 1\right)}}, \sin t \cdot ew, \left(\cos t \cdot eh\right) \cdot \sin \tan^{-1} \left(\frac{eh}{\tan t \cdot ew}\right)\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. Step-by-step derivation
    1. lift-/.f64N/A

      \[\leadsto \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} \color{blue}{\left(\frac{\frac{eh}{ew}}{\tan t}\right)}\right| \]
    2. lift-/.f64N/A

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

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

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

      \[\leadsto \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{eh}{\color{blue}{\tan t \cdot ew}}\right)\right| \]
  4. Applied rewrites99.8%

    \[\leadsto \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} \color{blue}{\left(\frac{eh}{\tan t \cdot ew}\right)}\right| \]
  5. 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{eh}{\tan t \cdot ew}\right)\right| \]
  6. 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{eh}{\tan t \cdot ew}\right)\right| \]
    2. lower-*.f6499.4

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

    \[\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{eh}{\tan t \cdot ew}\right)\right| \]
  8. Step-by-step derivation
    1. lift-+.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 99.0% accurate, 1.5× speedup?

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

\\
\begin{array}{l}
t_1 := \frac{eh}{t \cdot ew}\\
\left|\mathsf{fma}\left(\cos t, \sin \tan^{-1} \left(\frac{eh}{\tan t \cdot ew}\right) \cdot eh, \frac{\sin t \cdot ew}{\sqrt{\mathsf{fma}\left(t\_1, t\_1, 1\right)}}\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. Step-by-step derivation
    1. lift-/.f64N/A

      \[\leadsto \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} \color{blue}{\left(\frac{\frac{eh}{ew}}{\tan t}\right)}\right| \]
    2. lift-/.f64N/A

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

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

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

      \[\leadsto \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{eh}{\color{blue}{\tan t \cdot ew}}\right)\right| \]
  4. Applied rewrites99.8%

    \[\leadsto \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} \color{blue}{\left(\frac{eh}{\tan t \cdot ew}\right)}\right| \]
  5. 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{eh}{\tan t \cdot ew}\right)\right| \]
  6. 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{eh}{\tan t \cdot ew}\right)\right| \]
    2. lower-*.f6499.4

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

    \[\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{eh}{\tan t \cdot ew}\right)\right| \]
  8. Step-by-step derivation
    1. lift-+.f64N/A

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 98.3% accurate, 1.6× speedup?

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

\\
\left|\mathsf{fma}\left(\sin t, ew, \left(\cos t \cdot eh\right) \cdot \sin \tan^{-1} \left(\frac{eh}{\tan t \cdot ew}\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-+.f64N/A

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

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

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

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

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

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

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

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

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

Alternative 6: 91.4% accurate, 1.7× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;\left|\mathsf{fma}\left(\frac{1}{\sqrt{\mathsf{fma}\left(t\_1, t\_1, 1\right)}}, t\_2, \sin \tan^{-1} t\_1 \cdot \left(\cos t \cdot eh\right)\right)\right|\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -1.8e35

    1. Initial program 99.5%

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

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

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

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

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

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

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

      \[\leadsto \left|\mathsf{fma}\left(\frac{eh}{\tan t \cdot ew}, \sin t \cdot ew, \frac{\sin t \cdot ew}{\color{blue}{1}}\right)\right| \]
    8. Step-by-step derivation
      1. Applied rewrites88.6%

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

      if -1.8e35 < t

      1. Initial program 99.9%

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

          \[\leadsto \left|\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} \color{blue}{\left(\frac{\frac{eh}{ew}}{\tan t}\right)}\right| \]
        2. lift-/.f64N/A

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

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

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

          \[\leadsto \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{eh}{\color{blue}{\tan t \cdot ew}}\right)\right| \]
      4. Applied rewrites99.9%

        \[\leadsto \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} \color{blue}{\left(\frac{eh}{\tan t \cdot ew}\right)}\right| \]
      5. 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{eh}{\tan t \cdot ew}\right)\right| \]
      6. 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{eh}{\tan t \cdot ew}\right)\right| \]
        2. lower-*.f6499.7

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

        \[\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{eh}{\tan t \cdot ew}\right)\right| \]
      8. Step-by-step derivation
        1. lift-+.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -1.8 \cdot 10^{+35}:\\ \;\;\;\;\left|\mathsf{fma}\left(\frac{eh}{\tan t \cdot ew}, \sin t \cdot ew, \frac{\sin t \cdot ew}{1}\right)\right|\\ \mathbf{else}:\\ \;\;\;\;\left|\mathsf{fma}\left(\frac{1}{\sqrt{\mathsf{fma}\left(\frac{eh}{t \cdot ew}, \frac{eh}{t \cdot ew}, 1\right)}}, \sin t \cdot ew, \sin \tan^{-1} \left(\frac{eh}{t \cdot ew}\right) \cdot \left(\cos t \cdot eh\right)\right)\right|\\ \end{array} \]
    11. Add Preprocessing

    Alternative 7: 90.7% accurate, 2.0× speedup?

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

      1. Initial program 99.5%

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

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

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

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

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

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

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

        \[\leadsto \left|\mathsf{fma}\left(\frac{eh}{\tan t \cdot ew}, \sin t \cdot ew, \frac{\sin t \cdot ew}{\color{blue}{1}}\right)\right| \]
      8. Step-by-step derivation
        1. Applied rewrites88.6%

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

        if -1.8e35 < t

        1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -1.8 \cdot 10^{+35}:\\ \;\;\;\;\left|\mathsf{fma}\left(\frac{eh}{\tan t \cdot ew}, \sin t \cdot ew, \frac{\sin t \cdot ew}{1}\right)\right|\\ \mathbf{else}:\\ \;\;\;\;\left|\mathsf{fma}\left(\sin t, ew, \sin \tan^{-1} \left(\frac{eh}{t \cdot ew}\right) \cdot \left(\cos t \cdot eh\right)\right)\right|\\ \end{array} \]
      11. Add Preprocessing

      Alternative 8: 91.6% accurate, 2.4× speedup?

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

        1. Initial program 99.6%

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

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

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

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

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

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

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

          \[\leadsto \left|\mathsf{fma}\left(\frac{eh}{\tan t \cdot ew}, \sin t \cdot ew, \frac{\sin t \cdot ew}{\color{blue}{1}}\right)\right| \]
        8. Step-by-step derivation
          1. Applied rewrites86.8%

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

          if -1.55e11 < t < 1.74999999999999997e-6

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

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

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

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

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

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

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

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

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

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

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

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

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

            \[\leadsto \left|\mathsf{fma}\left(t \cdot \color{blue}{\left(1 + \frac{-1}{6} \cdot {t}^{2}\right)}, ew, \sin \tan^{-1} \left(\frac{eh}{ew \cdot t}\right) \cdot \left(\cos t \cdot eh\right)\right)\right| \]
          12. Step-by-step derivation
            1. Applied rewrites98.8%

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

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

          Alternative 9: 89.0% accurate, 2.4× speedup?

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

            1. Initial program 99.8%

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

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

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

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

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

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

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

              \[\leadsto \left|\mathsf{fma}\left(\frac{eh}{\tan t \cdot ew}, \sin t \cdot ew, \frac{\sin t \cdot ew}{\color{blue}{1}}\right)\right| \]
            8. Step-by-step derivation
              1. Applied rewrites91.5%

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

              if -11500 < ew < 7.8000000000000005e-46

              1. Initial program 99.8%

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

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

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

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

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

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

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

            Alternative 10: 80.5% accurate, 2.8× speedup?

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

              1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

              if -7e10 < ew < 1.65000000000000001e56

              1. Initial program 99.8%

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

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

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

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

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

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

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

            Alternative 11: 74.6% accurate, 6.1× speedup?

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

              1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

              if -1.35000000000000006e32 < ew < 4.80000000000000027e56

              1. Initial program 99.8%

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

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

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

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

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

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

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

              if 4.80000000000000027e56 < ew

              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. Applied rewrites94.6%

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

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

                  \[\leadsto \frac{1}{\left|\color{blue}{\frac{1}{ew \cdot \sin t}}\right|} \]
                2. *-commutativeN/A

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

                  \[\leadsto \frac{1}{\left|\frac{1}{\color{blue}{\sin t \cdot ew}}\right|} \]
                4. lower-sin.f6475.0

                  \[\leadsto \frac{1}{\left|\frac{1}{\color{blue}{\sin t} \cdot ew}\right|} \]
              6. Applied rewrites75.0%

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

            Alternative 12: 74.6% accurate, 7.2× speedup?

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

              1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

              if -1.35000000000000006e32 < ew < 1.65000000000000001e56

              1. Initial program 99.8%

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

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

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

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

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

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

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

            Alternative 13: 63.8% accurate, 7.2× speedup?

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

              1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

                  \[\leadsto \color{blue}{\sin t \cdot ew} \]
                2. lower-*.f64N/A

                  \[\leadsto \color{blue}{\sin t \cdot ew} \]
                3. lower-sin.f6443.5

                  \[\leadsto \color{blue}{\sin t} \cdot ew \]
              8. Applied rewrites43.5%

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

              if -1.48000000000000008e200 < ew < 7.59999999999999956e86

              1. Initial program 99.8%

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

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

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

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

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

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

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

            Alternative 14: 47.7% accurate, 7.4× speedup?

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

              1. Initial program 99.6%

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

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

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

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

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

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

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

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

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

                  \[\leadsto \color{blue}{\sin t \cdot ew} \]
                2. lower-*.f64N/A

                  \[\leadsto \color{blue}{\sin t \cdot ew} \]
                3. lower-sin.f6433.4

                  \[\leadsto \color{blue}{\sin t} \cdot ew \]
              8. Applied rewrites33.4%

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

              if -8.19999999999999959e67 < t < 1.45e-19

              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. Applied rewrites39.5%

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

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

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

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

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

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

                \[\leadsto \left|1 \cdot eh\right| \]
              8. Step-by-step derivation
                1. Applied rewrites69.0%

                  \[\leadsto \left|1 \cdot eh\right| \]
              9. Recombined 2 regimes into one program.
              10. Add Preprocessing

              Alternative 15: 42.3% accurate, 108.8× speedup?

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

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

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

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

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

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

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

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

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

                Reproduce

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