Example from Robby

Percentage Accurate: 99.8% → 99.8%
Time: 23.2s
Alternatives: 11
Speedup: N/A×

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 11 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.1× speedup?

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

\\
\begin{array}{l}
t_1 := \frac{\frac{eh}{ew}}{\tan t}\\
\left|\left(ew \cdot \sin t\right) \cdot \frac{1}{\mathsf{hypot}\left(1, t_1\right)} + \sin \tan^{-1} t_1 \cdot \left(eh \cdot \cos t\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. Step-by-step derivation
    1. associate-/l/99.8%

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

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

      \[\leadsto \left|\left(ew \cdot \sin t\right) \cdot \frac{1}{\color{blue}{\mathsf{hypot}\left(1, \frac{eh}{\tan t \cdot ew}\right)}} + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
    4. associate-/l/99.8%

      \[\leadsto \left|\left(ew \cdot \sin t\right) \cdot \frac{1}{\mathsf{hypot}\left(1, \color{blue}{\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. Applied egg-rr99.8%

    \[\leadsto \left|\left(ew \cdot \sin t\right) \cdot \color{blue}{\frac{1}{\mathsf{hypot}\left(1, \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. Final simplification99.8%

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

Alternative 2: 99.7% accurate, 1.1× speedup?

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

\\
\left|\sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right) \cdot \left(eh \cdot \cos t\right) + \frac{ew}{\frac{\mathsf{hypot}\left(1, \frac{eh}{ew \cdot \tan t}\right)}{\sin t}}\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. Step-by-step derivation
    1. associate-/l/99.8%

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

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

      \[\leadsto \left|\left(ew \cdot \sin t\right) \cdot \frac{1}{\color{blue}{\mathsf{hypot}\left(1, \frac{eh}{\tan t \cdot ew}\right)}} + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
    4. associate-/l/99.8%

      \[\leadsto \left|\left(ew \cdot \sin t\right) \cdot \frac{1}{\mathsf{hypot}\left(1, \color{blue}{\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. Applied egg-rr99.8%

    \[\leadsto \left|\left(ew \cdot \sin t\right) \cdot \color{blue}{\frac{1}{\mathsf{hypot}\left(1, \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. Step-by-step derivation
    1. un-div-inv99.8%

      \[\leadsto \left|\color{blue}{\frac{ew \cdot \sin t}{\mathsf{hypot}\left(1, \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. associate-/l*99.7%

      \[\leadsto \left|\color{blue}{\frac{ew}{\frac{\mathsf{hypot}\left(1, \frac{\frac{eh}{ew}}{\tan t}\right)}{\sin t}}} + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
    3. associate-/r*99.7%

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

    \[\leadsto \left|\color{blue}{\frac{ew}{\frac{\mathsf{hypot}\left(1, \frac{eh}{ew \cdot \tan t}\right)}{\sin t}}} + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
  6. Final simplification99.7%

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

Alternative 3: 99.0% accurate, 1.1× speedup?

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

\\
\left|\sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right) \cdot \left(eh \cdot \cos t\right) + \left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{\frac{eh}{t}}{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. Taylor expanded in t around 0 98.9%

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

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

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

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

Alternative 4: 98.5% accurate, 1.5× speedup?

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

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

    \[\left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
  2. Step-by-step derivation
    1. fma-def99.8%

      \[\leadsto \left|\color{blue}{\mathsf{fma}\left(ew \cdot \sin t, \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)}\right| \]
    2. associate-/l/99.8%

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

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

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

    \[\leadsto \color{blue}{\left|\mathsf{fma}\left(ew \cdot \sin t, \cos \tan^{-1} \left(\frac{eh}{\tan t \cdot ew}\right), eh \cdot \left(\cos t \cdot \sin \tan^{-1} \left(\frac{eh}{\tan t \cdot ew}\right)\right)\right)\right|} \]
  4. Step-by-step derivation
    1. associate-*r*99.8%

      \[\leadsto \left|\mathsf{fma}\left(ew \cdot \sin t, \cos \tan^{-1} \left(\frac{eh}{\tan 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)\right| \]
    2. sin-atan62.2%

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

      \[\leadsto \left|\mathsf{fma}\left(ew \cdot \sin t, \cos \tan^{-1} \left(\frac{eh}{\tan t \cdot ew}\right), \color{blue}{\frac{\left(eh \cdot \cos t\right) \cdot \frac{eh}{\tan t \cdot ew}}{\sqrt{1 + \frac{eh}{\tan t \cdot ew} \cdot \frac{eh}{\tan t \cdot ew}}}}\right)\right| \]
    4. associate-/l/59.5%

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

      \[\leadsto \left|\mathsf{fma}\left(ew \cdot \sin t, \cos \tan^{-1} \left(\frac{eh}{\tan t \cdot ew}\right), \frac{\left(eh \cdot \cos t\right) \cdot \frac{\frac{eh}{ew}}{\tan t}}{\color{blue}{\mathsf{hypot}\left(1, \frac{eh}{\tan t \cdot ew}\right)}}\right)\right| \]
    6. associate-/l/72.0%

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

    \[\leadsto \left|\mathsf{fma}\left(ew \cdot \sin t, \cos \tan^{-1} \left(\frac{eh}{\tan t \cdot ew}\right), \color{blue}{\frac{\left(eh \cdot \cos t\right) \cdot \frac{\frac{eh}{ew}}{\tan t}}{\mathsf{hypot}\left(1, \frac{\frac{eh}{ew}}{\tan t}\right)}}\right)\right| \]
  6. Step-by-step derivation
    1. associate-/l*83.0%

      \[\leadsto \left|\mathsf{fma}\left(ew \cdot \sin t, \cos \tan^{-1} \left(\frac{eh}{\tan t \cdot ew}\right), \color{blue}{\frac{eh \cdot \cos t}{\frac{\mathsf{hypot}\left(1, \frac{\frac{eh}{ew}}{\tan t}\right)}{\frac{\frac{eh}{ew}}{\tan t}}}}\right)\right| \]
    2. associate-/r/79.0%

      \[\leadsto \left|\mathsf{fma}\left(ew \cdot \sin t, \cos \tan^{-1} \left(\frac{eh}{\tan t \cdot ew}\right), \color{blue}{\frac{eh \cdot \cos t}{\mathsf{hypot}\left(1, \frac{\frac{eh}{ew}}{\tan t}\right)} \cdot \frac{\frac{eh}{ew}}{\tan t}}\right)\right| \]
    3. associate-/l/78.9%

      \[\leadsto \left|\mathsf{fma}\left(ew \cdot \sin t, \cos \tan^{-1} \left(\frac{eh}{\tan t \cdot ew}\right), \frac{eh \cdot \cos t}{\mathsf{hypot}\left(1, \color{blue}{\frac{eh}{\tan t \cdot ew}}\right)} \cdot \frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
    4. associate-/l/79.1%

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

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

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

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

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

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

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

      \[\leadsto \left|\mathsf{fma}\left(ew \cdot \sin t, \color{blue}{\frac{1}{\sqrt{1 + \frac{\frac{eh}{ew}}{\tan t} \cdot \frac{\frac{eh}{ew}}{\tan t}}}}, \frac{eh \cdot \cos t}{\mathsf{hypot}\left(1, \frac{eh}{\tan t \cdot ew}\right)} \cdot \frac{eh}{\tan t \cdot ew}\right)\right| \]
    3. metadata-eval79.1%

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

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

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

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

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

      \[\leadsto \left|\mathsf{fma}\left(ew \cdot \sin t, {\left(\mathsf{hypot}\left(1, \frac{eh}{ew \cdot \tan t}\right)\right)}^{\color{blue}{-0.5}} \cdot {\left(\mathsf{hypot}\left(1, \frac{\frac{eh}{ew}}{\tan t}\right)\right)}^{\left(\frac{-1}{2}\right)}, \frac{eh \cdot \cos t}{\mathsf{hypot}\left(1, \frac{eh}{\tan t \cdot ew}\right)} \cdot \frac{eh}{\tan t \cdot ew}\right)\right| \]
    9. associate-/r*79.1%

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

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

    \[\leadsto \left|\mathsf{fma}\left(ew \cdot \sin t, \color{blue}{{\left(\mathsf{hypot}\left(1, \frac{eh}{ew \cdot \tan t}\right)\right)}^{-0.5} \cdot {\left(\mathsf{hypot}\left(1, \frac{eh}{ew \cdot \tan t}\right)\right)}^{-0.5}}, \cos t \cdot \left(-eh\right)\right)\right| \]
  13. Step-by-step derivation
    1. pow-sqr79.1%

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

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

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

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

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

Alternative 5: 86.9% accurate, 1.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;ew \leq -1.6 \cdot 10^{-20} \lor \neg \left(ew \leq 6.1 \cdot 10^{-130}\right):\\ \;\;\;\;\left|\mathsf{fma}\left(ew \cdot \sin t, \cos \tan^{-1} \left(\frac{eh}{ew \cdot \tan t}\right), -eh\right)\right|\\ \mathbf{else}:\\ \;\;\;\;\left|eh \cdot \cos t\right|\\ \end{array} \end{array} \]
(FPCore (eh ew t)
 :precision binary64
 (if (or (<= ew -1.6e-20) (not (<= ew 6.1e-130)))
   (fabs (fma (* ew (sin t)) (cos (atan (/ eh (* ew (tan t))))) (- eh)))
   (fabs (* eh (cos t)))))
double code(double eh, double ew, double t) {
	double tmp;
	if ((ew <= -1.6e-20) || !(ew <= 6.1e-130)) {
		tmp = fabs(fma((ew * sin(t)), cos(atan((eh / (ew * tan(t))))), -eh));
	} else {
		tmp = fabs((eh * cos(t)));
	}
	return tmp;
}
function code(eh, ew, t)
	tmp = 0.0
	if ((ew <= -1.6e-20) || !(ew <= 6.1e-130))
		tmp = abs(fma(Float64(ew * sin(t)), cos(atan(Float64(eh / Float64(ew * tan(t))))), Float64(-eh)));
	else
		tmp = abs(Float64(eh * cos(t)));
	end
	return tmp
end
code[eh_, ew_, t_] := If[Or[LessEqual[ew, -1.6e-20], N[Not[LessEqual[ew, 6.1e-130]], $MachinePrecision]], N[Abs[N[(N[(ew * N[Sin[t], $MachinePrecision]), $MachinePrecision] * N[Cos[N[ArcTan[N[(eh / N[(ew * N[Tan[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] + (-eh)), $MachinePrecision]], $MachinePrecision], N[Abs[N[(eh * N[Cos[t], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;ew \leq -1.6 \cdot 10^{-20} \lor \neg \left(ew \leq 6.1 \cdot 10^{-130}\right):\\
\;\;\;\;\left|\mathsf{fma}\left(ew \cdot \sin t, \cos \tan^{-1} \left(\frac{eh}{ew \cdot \tan t}\right), -eh\right)\right|\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if ew < -1.59999999999999985e-20 or 6.09999999999999996e-130 < 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. Step-by-step derivation
      1. fma-def99.8%

        \[\leadsto \left|\color{blue}{\mathsf{fma}\left(ew \cdot \sin t, \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)}\right| \]
      2. associate-/l/99.8%

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

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

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

      \[\leadsto \color{blue}{\left|\mathsf{fma}\left(ew \cdot \sin t, \cos \tan^{-1} \left(\frac{eh}{\tan t \cdot ew}\right), eh \cdot \left(\cos t \cdot \sin \tan^{-1} \left(\frac{eh}{\tan t \cdot ew}\right)\right)\right)\right|} \]
    4. Step-by-step derivation
      1. associate-*r*99.8%

        \[\leadsto \left|\mathsf{fma}\left(ew \cdot \sin t, \cos \tan^{-1} \left(\frac{eh}{\tan 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)\right| \]
      2. sin-atan79.3%

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

        \[\leadsto \left|\mathsf{fma}\left(ew \cdot \sin t, \cos \tan^{-1} \left(\frac{eh}{\tan t \cdot ew}\right), \color{blue}{\frac{\left(eh \cdot \cos t\right) \cdot \frac{eh}{\tan t \cdot ew}}{\sqrt{1 + \frac{eh}{\tan t \cdot ew} \cdot \frac{eh}{\tan t \cdot ew}}}}\right)\right| \]
      4. associate-/l/74.8%

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

        \[\leadsto \left|\mathsf{fma}\left(ew \cdot \sin t, \cos \tan^{-1} \left(\frac{eh}{\tan t \cdot ew}\right), \frac{\left(eh \cdot \cos t\right) \cdot \frac{\frac{eh}{ew}}{\tan t}}{\color{blue}{\mathsf{hypot}\left(1, \frac{eh}{\tan t \cdot ew}\right)}}\right)\right| \]
      6. associate-/l/78.6%

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

      \[\leadsto \left|\mathsf{fma}\left(ew \cdot \sin t, \cos \tan^{-1} \left(\frac{eh}{\tan t \cdot ew}\right), \color{blue}{\frac{\left(eh \cdot \cos t\right) \cdot \frac{\frac{eh}{ew}}{\tan t}}{\mathsf{hypot}\left(1, \frac{\frac{eh}{ew}}{\tan t}\right)}}\right)\right| \]
    6. Step-by-step derivation
      1. associate-/l*91.8%

        \[\leadsto \left|\mathsf{fma}\left(ew \cdot \sin t, \cos \tan^{-1} \left(\frac{eh}{\tan t \cdot ew}\right), \color{blue}{\frac{eh \cdot \cos t}{\frac{\mathsf{hypot}\left(1, \frac{\frac{eh}{ew}}{\tan t}\right)}{\frac{\frac{eh}{ew}}{\tan t}}}}\right)\right| \]
      2. associate-/r/90.9%

        \[\leadsto \left|\mathsf{fma}\left(ew \cdot \sin t, \cos \tan^{-1} \left(\frac{eh}{\tan t \cdot ew}\right), \color{blue}{\frac{eh \cdot \cos t}{\mathsf{hypot}\left(1, \frac{\frac{eh}{ew}}{\tan t}\right)} \cdot \frac{\frac{eh}{ew}}{\tan t}}\right)\right| \]
      3. associate-/l/90.8%

        \[\leadsto \left|\mathsf{fma}\left(ew \cdot \sin t, \cos \tan^{-1} \left(\frac{eh}{\tan t \cdot ew}\right), \frac{eh \cdot \cos t}{\mathsf{hypot}\left(1, \color{blue}{\frac{eh}{\tan t \cdot ew}}\right)} \cdot \frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
      4. associate-/l/91.1%

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

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

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

        \[\leadsto \left|\mathsf{fma}\left(ew \cdot \sin t, \cos \tan^{-1} \left(\frac{eh}{\tan t \cdot ew}\right), \color{blue}{-\cos t \cdot eh}\right)\right| \]
      2. distribute-rgt-neg-out98.9%

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

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

      \[\leadsto \left|\mathsf{fma}\left(ew \cdot \sin t, \cos \tan^{-1} \left(\frac{eh}{\tan t \cdot ew}\right), \color{blue}{-1 \cdot eh}\right)\right| \]
    12. Step-by-step derivation
      1. mul-1-neg84.4%

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

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

    if -1.59999999999999985e-20 < ew < 6.09999999999999996e-130

    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. Step-by-step derivation
      1. fma-def99.7%

        \[\leadsto \left|\color{blue}{\mathsf{fma}\left(ew \cdot \sin t, \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)}\right| \]
      2. associate-/l/99.7%

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

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

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

      \[\leadsto \color{blue}{\left|\mathsf{fma}\left(ew \cdot \sin t, \cos \tan^{-1} \left(\frac{eh}{\tan t \cdot ew}\right), eh \cdot \left(\cos t \cdot \sin \tan^{-1} \left(\frac{eh}{\tan t \cdot ew}\right)\right)\right)\right|} \]
    4. Step-by-step derivation
      1. associate-*r*99.7%

        \[\leadsto \left|\mathsf{fma}\left(ew \cdot \sin t, \cos \tan^{-1} \left(\frac{eh}{\tan 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)\right| \]
      2. sin-atan32.8%

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

        \[\leadsto \left|\mathsf{fma}\left(ew \cdot \sin t, \cos \tan^{-1} \left(\frac{eh}{\tan t \cdot ew}\right), \color{blue}{\frac{\left(eh \cdot \cos t\right) \cdot \frac{eh}{\tan t \cdot ew}}{\sqrt{1 + \frac{eh}{\tan t \cdot ew} \cdot \frac{eh}{\tan t \cdot ew}}}}\right)\right| \]
      4. associate-/l/33.0%

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

        \[\leadsto \left|\mathsf{fma}\left(ew \cdot \sin t, \cos \tan^{-1} \left(\frac{eh}{\tan t \cdot ew}\right), \frac{\left(eh \cdot \cos t\right) \cdot \frac{\frac{eh}{ew}}{\tan t}}{\color{blue}{\mathsf{hypot}\left(1, \frac{eh}{\tan t \cdot ew}\right)}}\right)\right| \]
      6. associate-/l/60.7%

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

      \[\leadsto \left|\mathsf{fma}\left(ew \cdot \sin t, \cos \tan^{-1} \left(\frac{eh}{\tan t \cdot ew}\right), \color{blue}{\frac{\left(eh \cdot \cos t\right) \cdot \frac{\frac{eh}{ew}}{\tan t}}{\mathsf{hypot}\left(1, \frac{\frac{eh}{ew}}{\tan t}\right)}}\right)\right| \]
    6. Step-by-step derivation
      1. associate-/l*67.9%

        \[\leadsto \left|\mathsf{fma}\left(ew \cdot \sin t, \cos \tan^{-1} \left(\frac{eh}{\tan t \cdot ew}\right), \color{blue}{\frac{eh \cdot \cos t}{\frac{\mathsf{hypot}\left(1, \frac{\frac{eh}{ew}}{\tan t}\right)}{\frac{\frac{eh}{ew}}{\tan t}}}}\right)\right| \]
      2. associate-/r/58.4%

        \[\leadsto \left|\mathsf{fma}\left(ew \cdot \sin t, \cos \tan^{-1} \left(\frac{eh}{\tan t \cdot ew}\right), \color{blue}{\frac{eh \cdot \cos t}{\mathsf{hypot}\left(1, \frac{\frac{eh}{ew}}{\tan t}\right)} \cdot \frac{\frac{eh}{ew}}{\tan t}}\right)\right| \]
      3. associate-/l/58.3%

        \[\leadsto \left|\mathsf{fma}\left(ew \cdot \sin t, \cos \tan^{-1} \left(\frac{eh}{\tan t \cdot ew}\right), \frac{eh \cdot \cos t}{\mathsf{hypot}\left(1, \color{blue}{\frac{eh}{\tan t \cdot ew}}\right)} \cdot \frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
      4. associate-/l/58.3%

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

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

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

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

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

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

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

      \[\leadsto \left|\color{blue}{-1 \cdot \left(\cos t \cdot eh\right)}\right| \]
    13. Step-by-step derivation
      1. mul-1-neg91.4%

        \[\leadsto \left|\color{blue}{-\cos t \cdot eh}\right| \]
      2. distribute-rgt-neg-out91.4%

        \[\leadsto \left|\color{blue}{\cos t \cdot \left(-eh\right)}\right| \]
    14. Simplified91.4%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;ew \leq -1.6 \cdot 10^{-20} \lor \neg \left(ew \leq 6.1 \cdot 10^{-130}\right):\\ \;\;\;\;\left|\mathsf{fma}\left(ew \cdot \sin t, \cos \tan^{-1} \left(\frac{eh}{ew \cdot \tan t}\right), -eh\right)\right|\\ \mathbf{else}:\\ \;\;\;\;\left|eh \cdot \cos t\right|\\ \end{array} \]

Alternative 6: 98.5% accurate, 1.5× speedup?

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

\\
\left|\mathsf{fma}\left(ew \cdot \sin t, \frac{1}{\mathsf{hypot}\left(1, \frac{eh}{ew \cdot \tan t}\right)}, eh \cdot \cos 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. Step-by-step derivation
    1. fma-def99.8%

      \[\leadsto \left|\color{blue}{\mathsf{fma}\left(ew \cdot \sin t, \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)}\right| \]
    2. associate-/l/99.8%

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

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

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

    \[\leadsto \color{blue}{\left|\mathsf{fma}\left(ew \cdot \sin t, \cos \tan^{-1} \left(\frac{eh}{\tan t \cdot ew}\right), eh \cdot \left(\cos t \cdot \sin \tan^{-1} \left(\frac{eh}{\tan t \cdot ew}\right)\right)\right)\right|} \]
  4. Step-by-step derivation
    1. associate-*r*99.8%

      \[\leadsto \left|\mathsf{fma}\left(ew \cdot \sin t, \cos \tan^{-1} \left(\frac{eh}{\tan 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)\right| \]
    2. sin-atan62.2%

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

      \[\leadsto \left|\mathsf{fma}\left(ew \cdot \sin t, \cos \tan^{-1} \left(\frac{eh}{\tan t \cdot ew}\right), \color{blue}{\frac{\left(eh \cdot \cos t\right) \cdot \frac{eh}{\tan t \cdot ew}}{\sqrt{1 + \frac{eh}{\tan t \cdot ew} \cdot \frac{eh}{\tan t \cdot ew}}}}\right)\right| \]
    4. associate-/l/59.5%

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

      \[\leadsto \left|\mathsf{fma}\left(ew \cdot \sin t, \cos \tan^{-1} \left(\frac{eh}{\tan t \cdot ew}\right), \frac{\left(eh \cdot \cos t\right) \cdot \frac{\frac{eh}{ew}}{\tan t}}{\color{blue}{\mathsf{hypot}\left(1, \frac{eh}{\tan t \cdot ew}\right)}}\right)\right| \]
    6. associate-/l/72.0%

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

    \[\leadsto \left|\mathsf{fma}\left(ew \cdot \sin t, \cos \tan^{-1} \left(\frac{eh}{\tan t \cdot ew}\right), \color{blue}{\frac{\left(eh \cdot \cos t\right) \cdot \frac{\frac{eh}{ew}}{\tan t}}{\mathsf{hypot}\left(1, \frac{\frac{eh}{ew}}{\tan t}\right)}}\right)\right| \]
  6. Step-by-step derivation
    1. associate-/l*83.0%

      \[\leadsto \left|\mathsf{fma}\left(ew \cdot \sin t, \cos \tan^{-1} \left(\frac{eh}{\tan t \cdot ew}\right), \color{blue}{\frac{eh \cdot \cos t}{\frac{\mathsf{hypot}\left(1, \frac{\frac{eh}{ew}}{\tan t}\right)}{\frac{\frac{eh}{ew}}{\tan t}}}}\right)\right| \]
    2. associate-/r/79.0%

      \[\leadsto \left|\mathsf{fma}\left(ew \cdot \sin t, \cos \tan^{-1} \left(\frac{eh}{\tan t \cdot ew}\right), \color{blue}{\frac{eh \cdot \cos t}{\mathsf{hypot}\left(1, \frac{\frac{eh}{ew}}{\tan t}\right)} \cdot \frac{\frac{eh}{ew}}{\tan t}}\right)\right| \]
    3. associate-/l/78.9%

      \[\leadsto \left|\mathsf{fma}\left(ew \cdot \sin t, \cos \tan^{-1} \left(\frac{eh}{\tan t \cdot ew}\right), \frac{eh \cdot \cos t}{\mathsf{hypot}\left(1, \color{blue}{\frac{eh}{\tan t \cdot ew}}\right)} \cdot \frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
    4. associate-/l/79.1%

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

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

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

      \[\leadsto \left|\mathsf{fma}\left(ew \cdot \sin t, \color{blue}{\frac{1}{\sqrt{1 + \frac{\frac{eh}{ew}}{\tan t} \cdot \frac{\frac{eh}{ew}}{\tan t}}}}, \frac{eh \cdot \cos t}{\mathsf{hypot}\left(1, \frac{eh}{\tan t \cdot ew}\right)} \cdot \frac{eh}{\tan t \cdot ew}\right)\right| \]
    3. metadata-eval79.1%

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

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

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

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

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

      \[\leadsto \left|\mathsf{fma}\left(ew \cdot \sin t, {\left(\mathsf{hypot}\left(1, \frac{eh}{ew \cdot \tan t}\right)\right)}^{\color{blue}{-0.5}} \cdot {\left(\mathsf{hypot}\left(1, \frac{\frac{eh}{ew}}{\tan t}\right)\right)}^{\left(\frac{-1}{2}\right)}, \frac{eh \cdot \cos t}{\mathsf{hypot}\left(1, \frac{eh}{\tan t \cdot ew}\right)} \cdot \frac{eh}{\tan t \cdot ew}\right)\right| \]
    9. associate-/r*79.1%

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

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

    \[\leadsto \left|\mathsf{fma}\left(ew \cdot \sin t, \color{blue}{{\left(\mathsf{hypot}\left(1, \frac{eh}{ew \cdot \tan t}\right)\right)}^{-0.5} \cdot {\left(\mathsf{hypot}\left(1, \frac{eh}{ew \cdot \tan t}\right)\right)}^{-0.5}}, \frac{eh \cdot \cos t}{\mathsf{hypot}\left(1, \frac{eh}{\tan t \cdot ew}\right)} \cdot \frac{eh}{\tan t \cdot ew}\right)\right| \]
  10. Step-by-step derivation
    1. pow-sqr79.1%

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

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

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

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

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

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

Alternative 7: 98.6% accurate, 1.5× speedup?

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

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

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

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

      \[\leadsto \left|\left(ew \cdot \sin t\right) \cdot \frac{1}{\color{blue}{\mathsf{hypot}\left(1, \frac{eh}{\tan t \cdot ew}\right)}} + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
    4. associate-/l/99.8%

      \[\leadsto \left|\left(ew \cdot \sin t\right) \cdot \frac{1}{\mathsf{hypot}\left(1, \color{blue}{\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. Applied egg-rr99.8%

    \[\leadsto \left|\left(ew \cdot \sin t\right) \cdot \color{blue}{\frac{1}{\mathsf{hypot}\left(1, \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. Taylor expanded in ew around inf 98.5%

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

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

Alternative 8: 86.9% accurate, 1.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;ew \leq -7.2 \cdot 10^{-20} \lor \neg \left(ew \leq 4.2 \cdot 10^{-129}\right):\\ \;\;\;\;\left|\mathsf{fma}\left(ew \cdot \sin t, \frac{1}{\mathsf{hypot}\left(1, \frac{eh}{ew \cdot \tan t}\right)}, eh\right)\right|\\ \mathbf{else}:\\ \;\;\;\;\left|eh \cdot \cos t\right|\\ \end{array} \end{array} \]
(FPCore (eh ew t)
 :precision binary64
 (if (or (<= ew -7.2e-20) (not (<= ew 4.2e-129)))
   (fabs (fma (* ew (sin t)) (/ 1.0 (hypot 1.0 (/ eh (* ew (tan t))))) eh))
   (fabs (* eh (cos t)))))
double code(double eh, double ew, double t) {
	double tmp;
	if ((ew <= -7.2e-20) || !(ew <= 4.2e-129)) {
		tmp = fabs(fma((ew * sin(t)), (1.0 / hypot(1.0, (eh / (ew * tan(t))))), eh));
	} else {
		tmp = fabs((eh * cos(t)));
	}
	return tmp;
}
function code(eh, ew, t)
	tmp = 0.0
	if ((ew <= -7.2e-20) || !(ew <= 4.2e-129))
		tmp = abs(fma(Float64(ew * sin(t)), Float64(1.0 / hypot(1.0, Float64(eh / Float64(ew * tan(t))))), eh));
	else
		tmp = abs(Float64(eh * cos(t)));
	end
	return tmp
end
code[eh_, ew_, t_] := If[Or[LessEqual[ew, -7.2e-20], N[Not[LessEqual[ew, 4.2e-129]], $MachinePrecision]], N[Abs[N[(N[(ew * N[Sin[t], $MachinePrecision]), $MachinePrecision] * N[(1.0 / N[Sqrt[1.0 ^ 2 + N[(eh / N[(ew * N[Tan[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision] + eh), $MachinePrecision]], $MachinePrecision], N[Abs[N[(eh * N[Cos[t], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;ew \leq -7.2 \cdot 10^{-20} \lor \neg \left(ew \leq 4.2 \cdot 10^{-129}\right):\\
\;\;\;\;\left|\mathsf{fma}\left(ew \cdot \sin t, \frac{1}{\mathsf{hypot}\left(1, \frac{eh}{ew \cdot \tan t}\right)}, eh\right)\right|\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if ew < -7.19999999999999948e-20 or 4.2e-129 < 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. Step-by-step derivation
      1. fma-def99.8%

        \[\leadsto \left|\color{blue}{\mathsf{fma}\left(ew \cdot \sin t, \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)}\right| \]
      2. associate-/l/99.8%

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

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

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

      \[\leadsto \color{blue}{\left|\mathsf{fma}\left(ew \cdot \sin t, \cos \tan^{-1} \left(\frac{eh}{\tan t \cdot ew}\right), eh \cdot \left(\cos t \cdot \sin \tan^{-1} \left(\frac{eh}{\tan t \cdot ew}\right)\right)\right)\right|} \]
    4. Step-by-step derivation
      1. associate-*r*99.8%

        \[\leadsto \left|\mathsf{fma}\left(ew \cdot \sin t, \cos \tan^{-1} \left(\frac{eh}{\tan 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)\right| \]
      2. sin-atan79.3%

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

        \[\leadsto \left|\mathsf{fma}\left(ew \cdot \sin t, \cos \tan^{-1} \left(\frac{eh}{\tan t \cdot ew}\right), \color{blue}{\frac{\left(eh \cdot \cos t\right) \cdot \frac{eh}{\tan t \cdot ew}}{\sqrt{1 + \frac{eh}{\tan t \cdot ew} \cdot \frac{eh}{\tan t \cdot ew}}}}\right)\right| \]
      4. associate-/l/74.8%

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

        \[\leadsto \left|\mathsf{fma}\left(ew \cdot \sin t, \cos \tan^{-1} \left(\frac{eh}{\tan t \cdot ew}\right), \frac{\left(eh \cdot \cos t\right) \cdot \frac{\frac{eh}{ew}}{\tan t}}{\color{blue}{\mathsf{hypot}\left(1, \frac{eh}{\tan t \cdot ew}\right)}}\right)\right| \]
      6. associate-/l/78.6%

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

      \[\leadsto \left|\mathsf{fma}\left(ew \cdot \sin t, \cos \tan^{-1} \left(\frac{eh}{\tan t \cdot ew}\right), \color{blue}{\frac{\left(eh \cdot \cos t\right) \cdot \frac{\frac{eh}{ew}}{\tan t}}{\mathsf{hypot}\left(1, \frac{\frac{eh}{ew}}{\tan t}\right)}}\right)\right| \]
    6. Step-by-step derivation
      1. associate-/l*91.8%

        \[\leadsto \left|\mathsf{fma}\left(ew \cdot \sin t, \cos \tan^{-1} \left(\frac{eh}{\tan t \cdot ew}\right), \color{blue}{\frac{eh \cdot \cos t}{\frac{\mathsf{hypot}\left(1, \frac{\frac{eh}{ew}}{\tan t}\right)}{\frac{\frac{eh}{ew}}{\tan t}}}}\right)\right| \]
      2. associate-/r/90.9%

        \[\leadsto \left|\mathsf{fma}\left(ew \cdot \sin t, \cos \tan^{-1} \left(\frac{eh}{\tan t \cdot ew}\right), \color{blue}{\frac{eh \cdot \cos t}{\mathsf{hypot}\left(1, \frac{\frac{eh}{ew}}{\tan t}\right)} \cdot \frac{\frac{eh}{ew}}{\tan t}}\right)\right| \]
      3. associate-/l/90.8%

        \[\leadsto \left|\mathsf{fma}\left(ew \cdot \sin t, \cos \tan^{-1} \left(\frac{eh}{\tan t \cdot ew}\right), \frac{eh \cdot \cos t}{\mathsf{hypot}\left(1, \color{blue}{\frac{eh}{\tan t \cdot ew}}\right)} \cdot \frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
      4. associate-/l/91.1%

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

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

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

        \[\leadsto \left|\mathsf{fma}\left(ew \cdot \sin t, \color{blue}{\frac{1}{\sqrt{1 + \frac{\frac{eh}{ew}}{\tan t} \cdot \frac{\frac{eh}{ew}}{\tan t}}}}, \frac{eh \cdot \cos t}{\mathsf{hypot}\left(1, \frac{eh}{\tan t \cdot ew}\right)} \cdot \frac{eh}{\tan t \cdot ew}\right)\right| \]
      3. metadata-eval91.1%

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

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

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

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

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

        \[\leadsto \left|\mathsf{fma}\left(ew \cdot \sin t, {\left(\mathsf{hypot}\left(1, \frac{eh}{ew \cdot \tan t}\right)\right)}^{\color{blue}{-0.5}} \cdot {\left(\mathsf{hypot}\left(1, \frac{\frac{eh}{ew}}{\tan t}\right)\right)}^{\left(\frac{-1}{2}\right)}, \frac{eh \cdot \cos t}{\mathsf{hypot}\left(1, \frac{eh}{\tan t \cdot ew}\right)} \cdot \frac{eh}{\tan t \cdot ew}\right)\right| \]
      9. associate-/r*91.1%

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

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

      \[\leadsto \left|\mathsf{fma}\left(ew \cdot \sin t, \color{blue}{{\left(\mathsf{hypot}\left(1, \frac{eh}{ew \cdot \tan t}\right)\right)}^{-0.5} \cdot {\left(\mathsf{hypot}\left(1, \frac{eh}{ew \cdot \tan t}\right)\right)}^{-0.5}}, \frac{eh \cdot \cos t}{\mathsf{hypot}\left(1, \frac{eh}{\tan t \cdot ew}\right)} \cdot \frac{eh}{\tan t \cdot ew}\right)\right| \]
    10. Step-by-step derivation
      1. pow-sqr91.1%

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

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

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

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

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

    if -7.19999999999999948e-20 < ew < 4.2e-129

    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. Step-by-step derivation
      1. fma-def99.7%

        \[\leadsto \left|\color{blue}{\mathsf{fma}\left(ew \cdot \sin t, \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)}\right| \]
      2. associate-/l/99.7%

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

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

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

      \[\leadsto \color{blue}{\left|\mathsf{fma}\left(ew \cdot \sin t, \cos \tan^{-1} \left(\frac{eh}{\tan t \cdot ew}\right), eh \cdot \left(\cos t \cdot \sin \tan^{-1} \left(\frac{eh}{\tan t \cdot ew}\right)\right)\right)\right|} \]
    4. Step-by-step derivation
      1. associate-*r*99.7%

        \[\leadsto \left|\mathsf{fma}\left(ew \cdot \sin t, \cos \tan^{-1} \left(\frac{eh}{\tan 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)\right| \]
      2. sin-atan32.8%

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

        \[\leadsto \left|\mathsf{fma}\left(ew \cdot \sin t, \cos \tan^{-1} \left(\frac{eh}{\tan t \cdot ew}\right), \color{blue}{\frac{\left(eh \cdot \cos t\right) \cdot \frac{eh}{\tan t \cdot ew}}{\sqrt{1 + \frac{eh}{\tan t \cdot ew} \cdot \frac{eh}{\tan t \cdot ew}}}}\right)\right| \]
      4. associate-/l/33.0%

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

        \[\leadsto \left|\mathsf{fma}\left(ew \cdot \sin t, \cos \tan^{-1} \left(\frac{eh}{\tan t \cdot ew}\right), \frac{\left(eh \cdot \cos t\right) \cdot \frac{\frac{eh}{ew}}{\tan t}}{\color{blue}{\mathsf{hypot}\left(1, \frac{eh}{\tan t \cdot ew}\right)}}\right)\right| \]
      6. associate-/l/60.7%

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

      \[\leadsto \left|\mathsf{fma}\left(ew \cdot \sin t, \cos \tan^{-1} \left(\frac{eh}{\tan t \cdot ew}\right), \color{blue}{\frac{\left(eh \cdot \cos t\right) \cdot \frac{\frac{eh}{ew}}{\tan t}}{\mathsf{hypot}\left(1, \frac{\frac{eh}{ew}}{\tan t}\right)}}\right)\right| \]
    6. Step-by-step derivation
      1. associate-/l*67.9%

        \[\leadsto \left|\mathsf{fma}\left(ew \cdot \sin t, \cos \tan^{-1} \left(\frac{eh}{\tan t \cdot ew}\right), \color{blue}{\frac{eh \cdot \cos t}{\frac{\mathsf{hypot}\left(1, \frac{\frac{eh}{ew}}{\tan t}\right)}{\frac{\frac{eh}{ew}}{\tan t}}}}\right)\right| \]
      2. associate-/r/58.4%

        \[\leadsto \left|\mathsf{fma}\left(ew \cdot \sin t, \cos \tan^{-1} \left(\frac{eh}{\tan t \cdot ew}\right), \color{blue}{\frac{eh \cdot \cos t}{\mathsf{hypot}\left(1, \frac{\frac{eh}{ew}}{\tan t}\right)} \cdot \frac{\frac{eh}{ew}}{\tan t}}\right)\right| \]
      3. associate-/l/58.3%

        \[\leadsto \left|\mathsf{fma}\left(ew \cdot \sin t, \cos \tan^{-1} \left(\frac{eh}{\tan t \cdot ew}\right), \frac{eh \cdot \cos t}{\mathsf{hypot}\left(1, \color{blue}{\frac{eh}{\tan t \cdot ew}}\right)} \cdot \frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
      4. associate-/l/58.3%

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

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

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

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

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

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

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

      \[\leadsto \left|\color{blue}{-1 \cdot \left(\cos t \cdot eh\right)}\right| \]
    13. Step-by-step derivation
      1. mul-1-neg91.4%

        \[\leadsto \left|\color{blue}{-\cos t \cdot eh}\right| \]
      2. distribute-rgt-neg-out91.4%

        \[\leadsto \left|\color{blue}{\cos t \cdot \left(-eh\right)}\right| \]
    14. Simplified91.4%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;ew \leq -7.2 \cdot 10^{-20} \lor \neg \left(ew \leq 4.2 \cdot 10^{-129}\right):\\ \;\;\;\;\left|\mathsf{fma}\left(ew \cdot \sin t, \frac{1}{\mathsf{hypot}\left(1, \frac{eh}{ew \cdot \tan t}\right)}, eh\right)\right|\\ \mathbf{else}:\\ \;\;\;\;\left|eh \cdot \cos t\right|\\ \end{array} \]

Alternative 9: 62.0% accurate, 2.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t \leq 1.26 \cdot 10^{-73} \lor \neg \left(t \leq 4.2 \cdot 10^{-5}\right):\\ \;\;\;\;\left|eh \cdot \cos t\right|\\ \mathbf{else}:\\ \;\;\;\;\left|\left(ew \cdot t\right) \cdot \cos \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right|\\ \end{array} \end{array} \]
(FPCore (eh ew t)
 :precision binary64
 (if (or (<= t 1.26e-73) (not (<= t 4.2e-5)))
   (fabs (* eh (cos t)))
   (fabs (* (* ew t) (cos (atan (/ (/ eh ew) (tan t))))))))
double code(double eh, double ew, double t) {
	double tmp;
	if ((t <= 1.26e-73) || !(t <= 4.2e-5)) {
		tmp = fabs((eh * cos(t)));
	} else {
		tmp = fabs(((ew * t) * cos(atan(((eh / ew) / tan(t))))));
	}
	return tmp;
}
real(8) function code(eh, ew, t)
    real(8), intent (in) :: eh
    real(8), intent (in) :: ew
    real(8), intent (in) :: t
    real(8) :: tmp
    if ((t <= 1.26d-73) .or. (.not. (t <= 4.2d-5))) then
        tmp = abs((eh * cos(t)))
    else
        tmp = abs(((ew * t) * cos(atan(((eh / ew) / tan(t))))))
    end if
    code = tmp
end function
public static double code(double eh, double ew, double t) {
	double tmp;
	if ((t <= 1.26e-73) || !(t <= 4.2e-5)) {
		tmp = Math.abs((eh * Math.cos(t)));
	} else {
		tmp = Math.abs(((ew * t) * Math.cos(Math.atan(((eh / ew) / Math.tan(t))))));
	}
	return tmp;
}
def code(eh, ew, t):
	tmp = 0
	if (t <= 1.26e-73) or not (t <= 4.2e-5):
		tmp = math.fabs((eh * math.cos(t)))
	else:
		tmp = math.fabs(((ew * t) * math.cos(math.atan(((eh / ew) / math.tan(t))))))
	return tmp
function code(eh, ew, t)
	tmp = 0.0
	if ((t <= 1.26e-73) || !(t <= 4.2e-5))
		tmp = abs(Float64(eh * cos(t)));
	else
		tmp = abs(Float64(Float64(ew * t) * cos(atan(Float64(Float64(eh / ew) / tan(t))))));
	end
	return tmp
end
function tmp_2 = code(eh, ew, t)
	tmp = 0.0;
	if ((t <= 1.26e-73) || ~((t <= 4.2e-5)))
		tmp = abs((eh * cos(t)));
	else
		tmp = abs(((ew * t) * cos(atan(((eh / ew) / tan(t))))));
	end
	tmp_2 = tmp;
end
code[eh_, ew_, t_] := If[Or[LessEqual[t, 1.26e-73], N[Not[LessEqual[t, 4.2e-5]], $MachinePrecision]], N[Abs[N[(eh * N[Cos[t], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Abs[N[(N[(ew * t), $MachinePrecision] * N[Cos[N[ArcTan[N[(N[(eh / ew), $MachinePrecision] / N[Tan[t], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;t \leq 1.26 \cdot 10^{-73} \lor \neg \left(t \leq 4.2 \cdot 10^{-5}\right):\\
\;\;\;\;\left|eh \cdot \cos t\right|\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < 1.26000000000000001e-73 or 4.19999999999999977e-5 < t

    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. Step-by-step derivation
      1. fma-def99.7%

        \[\leadsto \left|\color{blue}{\mathsf{fma}\left(ew \cdot \sin t, \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)}\right| \]
      2. associate-/l/99.7%

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

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

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

      \[\leadsto \color{blue}{\left|\mathsf{fma}\left(ew \cdot \sin t, \cos \tan^{-1} \left(\frac{eh}{\tan t \cdot ew}\right), eh \cdot \left(\cos t \cdot \sin \tan^{-1} \left(\frac{eh}{\tan t \cdot ew}\right)\right)\right)\right|} \]
    4. Step-by-step derivation
      1. associate-*r*99.7%

        \[\leadsto \left|\mathsf{fma}\left(ew \cdot \sin t, \cos \tan^{-1} \left(\frac{eh}{\tan 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)\right| \]
      2. sin-atan60.9%

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

        \[\leadsto \left|\mathsf{fma}\left(ew \cdot \sin t, \cos \tan^{-1} \left(\frac{eh}{\tan t \cdot ew}\right), \color{blue}{\frac{\left(eh \cdot \cos t\right) \cdot \frac{eh}{\tan t \cdot ew}}{\sqrt{1 + \frac{eh}{\tan t \cdot ew} \cdot \frac{eh}{\tan t \cdot ew}}}}\right)\right| \]
      4. associate-/l/57.9%

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

        \[\leadsto \left|\mathsf{fma}\left(ew \cdot \sin t, \cos \tan^{-1} \left(\frac{eh}{\tan t \cdot ew}\right), \frac{\left(eh \cdot \cos t\right) \cdot \frac{\frac{eh}{ew}}{\tan t}}{\color{blue}{\mathsf{hypot}\left(1, \frac{eh}{\tan t \cdot ew}\right)}}\right)\right| \]
      6. associate-/l/71.0%

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

      \[\leadsto \left|\mathsf{fma}\left(ew \cdot \sin t, \cos \tan^{-1} \left(\frac{eh}{\tan t \cdot ew}\right), \color{blue}{\frac{\left(eh \cdot \cos t\right) \cdot \frac{\frac{eh}{ew}}{\tan t}}{\mathsf{hypot}\left(1, \frac{\frac{eh}{ew}}{\tan t}\right)}}\right)\right| \]
    6. Step-by-step derivation
      1. associate-/l*82.1%

        \[\leadsto \left|\mathsf{fma}\left(ew \cdot \sin t, \cos \tan^{-1} \left(\frac{eh}{\tan t \cdot ew}\right), \color{blue}{\frac{eh \cdot \cos t}{\frac{\mathsf{hypot}\left(1, \frac{\frac{eh}{ew}}{\tan t}\right)}{\frac{\frac{eh}{ew}}{\tan t}}}}\right)\right| \]
      2. associate-/r/77.7%

        \[\leadsto \left|\mathsf{fma}\left(ew \cdot \sin t, \cos \tan^{-1} \left(\frac{eh}{\tan t \cdot ew}\right), \color{blue}{\frac{eh \cdot \cos t}{\mathsf{hypot}\left(1, \frac{\frac{eh}{ew}}{\tan t}\right)} \cdot \frac{\frac{eh}{ew}}{\tan t}}\right)\right| \]
      3. associate-/l/77.6%

        \[\leadsto \left|\mathsf{fma}\left(ew \cdot \sin t, \cos \tan^{-1} \left(\frac{eh}{\tan t \cdot ew}\right), \frac{eh \cdot \cos t}{\mathsf{hypot}\left(1, \color{blue}{\frac{eh}{\tan t \cdot ew}}\right)} \cdot \frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
      4. associate-/l/77.8%

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

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

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

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

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

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

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

      \[\leadsto \left|\color{blue}{-1 \cdot \left(\cos t \cdot eh\right)}\right| \]
    13. Step-by-step derivation
      1. mul-1-neg66.9%

        \[\leadsto \left|\color{blue}{-\cos t \cdot eh}\right| \]
      2. distribute-rgt-neg-out66.9%

        \[\leadsto \left|\color{blue}{\cos t \cdot \left(-eh\right)}\right| \]
    14. Simplified66.9%

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

    if 1.26000000000000001e-73 < t < 4.19999999999999977e-5

    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. Step-by-step derivation
      1. fma-def99.9%

        \[\leadsto \left|\color{blue}{\mathsf{fma}\left(ew \cdot \sin t, \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)}\right| \]
      2. associate-/l/99.9%

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

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

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

      \[\leadsto \color{blue}{\left|\mathsf{fma}\left(ew \cdot \sin t, \cos \tan^{-1} \left(\frac{eh}{\tan t \cdot ew}\right), eh \cdot \left(\cos t \cdot \sin \tan^{-1} \left(\frac{eh}{\tan t \cdot ew}\right)\right)\right)\right|} \]
    4. Step-by-step derivation
      1. associate-*r*99.9%

        \[\leadsto \left|\mathsf{fma}\left(ew \cdot \sin t, \cos \tan^{-1} \left(\frac{eh}{\tan 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)\right| \]
      2. sin-atan79.5%

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

        \[\leadsto \left|\mathsf{fma}\left(ew \cdot \sin t, \cos \tan^{-1} \left(\frac{eh}{\tan t \cdot ew}\right), \color{blue}{\frac{\left(eh \cdot \cos t\right) \cdot \frac{eh}{\tan t \cdot ew}}{\sqrt{1 + \frac{eh}{\tan t \cdot ew} \cdot \frac{eh}{\tan t \cdot ew}}}}\right)\right| \]
      4. associate-/l/79.1%

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

        \[\leadsto \left|\mathsf{fma}\left(ew \cdot \sin t, \cos \tan^{-1} \left(\frac{eh}{\tan t \cdot ew}\right), \frac{\left(eh \cdot \cos t\right) \cdot \frac{\frac{eh}{ew}}{\tan t}}{\color{blue}{\mathsf{hypot}\left(1, \frac{eh}{\tan t \cdot ew}\right)}}\right)\right| \]
      6. associate-/l/84.7%

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

      \[\leadsto \left|\mathsf{fma}\left(ew \cdot \sin t, \cos \tan^{-1} \left(\frac{eh}{\tan t \cdot ew}\right), \color{blue}{\frac{\left(eh \cdot \cos t\right) \cdot \frac{\frac{eh}{ew}}{\tan t}}{\mathsf{hypot}\left(1, \frac{\frac{eh}{ew}}{\tan t}\right)}}\right)\right| \]
    6. Step-by-step derivation
      1. associate-/l*94.7%

        \[\leadsto \left|\mathsf{fma}\left(ew \cdot \sin t, \cos \tan^{-1} \left(\frac{eh}{\tan t \cdot ew}\right), \color{blue}{\frac{eh \cdot \cos t}{\frac{\mathsf{hypot}\left(1, \frac{\frac{eh}{ew}}{\tan t}\right)}{\frac{\frac{eh}{ew}}{\tan t}}}}\right)\right| \]
      2. associate-/r/94.7%

        \[\leadsto \left|\mathsf{fma}\left(ew \cdot \sin t, \cos \tan^{-1} \left(\frac{eh}{\tan t \cdot ew}\right), \color{blue}{\frac{eh \cdot \cos t}{\mathsf{hypot}\left(1, \frac{\frac{eh}{ew}}{\tan t}\right)} \cdot \frac{\frac{eh}{ew}}{\tan t}}\right)\right| \]
      3. associate-/l/94.6%

        \[\leadsto \left|\mathsf{fma}\left(ew \cdot \sin t, \cos \tan^{-1} \left(\frac{eh}{\tan t \cdot ew}\right), \frac{eh \cdot \cos t}{\mathsf{hypot}\left(1, \color{blue}{\frac{eh}{\tan t \cdot ew}}\right)} \cdot \frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
      4. associate-/l/94.7%

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

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

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

        \[\leadsto \left|\mathsf{fma}\left(ew \cdot \sin t, \cos \tan^{-1} \left(\frac{eh}{\tan t \cdot ew}\right), \color{blue}{-\cos t \cdot eh}\right)\right| \]
      2. distribute-rgt-neg-out99.9%

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

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

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

      \[\leadsto \left|\color{blue}{t \cdot \left(\cos \tan^{-1} \left(\frac{eh}{\tan t \cdot ew}\right) \cdot ew\right)}\right| \]
    13. Step-by-step derivation
      1. *-commutative78.0%

        \[\leadsto \left|t \cdot \color{blue}{\left(ew \cdot \cos \tan^{-1} \left(\frac{eh}{\tan t \cdot ew}\right)\right)}\right| \]
      2. associate-*r*78.0%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq 1.26 \cdot 10^{-73} \lor \neg \left(t \leq 4.2 \cdot 10^{-5}\right):\\ \;\;\;\;\left|eh \cdot \cos t\right|\\ \mathbf{else}:\\ \;\;\;\;\left|\left(ew \cdot t\right) \cdot \cos \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right|\\ \end{array} \]

Alternative 10: 62.7% accurate, 4.5× speedup?

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

\\
\left|eh \cdot \cos t\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. Step-by-step derivation
    1. fma-def99.8%

      \[\leadsto \left|\color{blue}{\mathsf{fma}\left(ew \cdot \sin t, \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)}\right| \]
    2. associate-/l/99.8%

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

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

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

    \[\leadsto \color{blue}{\left|\mathsf{fma}\left(ew \cdot \sin t, \cos \tan^{-1} \left(\frac{eh}{\tan t \cdot ew}\right), eh \cdot \left(\cos t \cdot \sin \tan^{-1} \left(\frac{eh}{\tan t \cdot ew}\right)\right)\right)\right|} \]
  4. Step-by-step derivation
    1. associate-*r*99.8%

      \[\leadsto \left|\mathsf{fma}\left(ew \cdot \sin t, \cos \tan^{-1} \left(\frac{eh}{\tan 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)\right| \]
    2. sin-atan62.2%

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

      \[\leadsto \left|\mathsf{fma}\left(ew \cdot \sin t, \cos \tan^{-1} \left(\frac{eh}{\tan t \cdot ew}\right), \color{blue}{\frac{\left(eh \cdot \cos t\right) \cdot \frac{eh}{\tan t \cdot ew}}{\sqrt{1 + \frac{eh}{\tan t \cdot ew} \cdot \frac{eh}{\tan t \cdot ew}}}}\right)\right| \]
    4. associate-/l/59.5%

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

      \[\leadsto \left|\mathsf{fma}\left(ew \cdot \sin t, \cos \tan^{-1} \left(\frac{eh}{\tan t \cdot ew}\right), \frac{\left(eh \cdot \cos t\right) \cdot \frac{\frac{eh}{ew}}{\tan t}}{\color{blue}{\mathsf{hypot}\left(1, \frac{eh}{\tan t \cdot ew}\right)}}\right)\right| \]
    6. associate-/l/72.0%

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

    \[\leadsto \left|\mathsf{fma}\left(ew \cdot \sin t, \cos \tan^{-1} \left(\frac{eh}{\tan t \cdot ew}\right), \color{blue}{\frac{\left(eh \cdot \cos t\right) \cdot \frac{\frac{eh}{ew}}{\tan t}}{\mathsf{hypot}\left(1, \frac{\frac{eh}{ew}}{\tan t}\right)}}\right)\right| \]
  6. Step-by-step derivation
    1. associate-/l*83.0%

      \[\leadsto \left|\mathsf{fma}\left(ew \cdot \sin t, \cos \tan^{-1} \left(\frac{eh}{\tan t \cdot ew}\right), \color{blue}{\frac{eh \cdot \cos t}{\frac{\mathsf{hypot}\left(1, \frac{\frac{eh}{ew}}{\tan t}\right)}{\frac{\frac{eh}{ew}}{\tan t}}}}\right)\right| \]
    2. associate-/r/79.0%

      \[\leadsto \left|\mathsf{fma}\left(ew \cdot \sin t, \cos \tan^{-1} \left(\frac{eh}{\tan t \cdot ew}\right), \color{blue}{\frac{eh \cdot \cos t}{\mathsf{hypot}\left(1, \frac{\frac{eh}{ew}}{\tan t}\right)} \cdot \frac{\frac{eh}{ew}}{\tan t}}\right)\right| \]
    3. associate-/l/78.9%

      \[\leadsto \left|\mathsf{fma}\left(ew \cdot \sin t, \cos \tan^{-1} \left(\frac{eh}{\tan t \cdot ew}\right), \frac{eh \cdot \cos t}{\mathsf{hypot}\left(1, \color{blue}{\frac{eh}{\tan t \cdot ew}}\right)} \cdot \frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
    4. associate-/l/79.1%

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

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

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

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

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

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

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

    \[\leadsto \left|\color{blue}{-1 \cdot \left(\cos t \cdot eh\right)}\right| \]
  13. Step-by-step derivation
    1. mul-1-neg63.7%

      \[\leadsto \left|\color{blue}{-\cos t \cdot eh}\right| \]
    2. distribute-rgt-neg-out63.7%

      \[\leadsto \left|\color{blue}{\cos t \cdot \left(-eh\right)}\right| \]
  14. Simplified63.7%

    \[\leadsto \left|\color{blue}{\cos t \cdot \left(-eh\right)}\right| \]
  15. Final simplification63.7%

    \[\leadsto \left|eh \cdot \cos t\right| \]

Alternative 11: 43.4% accurate, 9.1× speedup?

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

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

    \[\left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
  2. Step-by-step derivation
    1. fma-def99.8%

      \[\leadsto \left|\color{blue}{\mathsf{fma}\left(ew \cdot \sin t, \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)}\right| \]
    2. associate-/l/99.8%

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

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

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

    \[\leadsto \color{blue}{\left|\mathsf{fma}\left(ew \cdot \sin t, \cos \tan^{-1} \left(\frac{eh}{\tan t \cdot ew}\right), eh \cdot \left(\cos t \cdot \sin \tan^{-1} \left(\frac{eh}{\tan t \cdot ew}\right)\right)\right)\right|} \]
  4. Step-by-step derivation
    1. associate-*r*99.8%

      \[\leadsto \left|\mathsf{fma}\left(ew \cdot \sin t, \cos \tan^{-1} \left(\frac{eh}{\tan 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)\right| \]
    2. sin-atan62.2%

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

      \[\leadsto \left|\mathsf{fma}\left(ew \cdot \sin t, \cos \tan^{-1} \left(\frac{eh}{\tan t \cdot ew}\right), \color{blue}{\frac{\left(eh \cdot \cos t\right) \cdot \frac{eh}{\tan t \cdot ew}}{\sqrt{1 + \frac{eh}{\tan t \cdot ew} \cdot \frac{eh}{\tan t \cdot ew}}}}\right)\right| \]
    4. associate-/l/59.5%

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

      \[\leadsto \left|\mathsf{fma}\left(ew \cdot \sin t, \cos \tan^{-1} \left(\frac{eh}{\tan t \cdot ew}\right), \frac{\left(eh \cdot \cos t\right) \cdot \frac{\frac{eh}{ew}}{\tan t}}{\color{blue}{\mathsf{hypot}\left(1, \frac{eh}{\tan t \cdot ew}\right)}}\right)\right| \]
    6. associate-/l/72.0%

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

    \[\leadsto \left|\mathsf{fma}\left(ew \cdot \sin t, \cos \tan^{-1} \left(\frac{eh}{\tan t \cdot ew}\right), \color{blue}{\frac{\left(eh \cdot \cos t\right) \cdot \frac{\frac{eh}{ew}}{\tan t}}{\mathsf{hypot}\left(1, \frac{\frac{eh}{ew}}{\tan t}\right)}}\right)\right| \]
  6. Step-by-step derivation
    1. associate-/l*83.0%

      \[\leadsto \left|\mathsf{fma}\left(ew \cdot \sin t, \cos \tan^{-1} \left(\frac{eh}{\tan t \cdot ew}\right), \color{blue}{\frac{eh \cdot \cos t}{\frac{\mathsf{hypot}\left(1, \frac{\frac{eh}{ew}}{\tan t}\right)}{\frac{\frac{eh}{ew}}{\tan t}}}}\right)\right| \]
    2. associate-/r/79.0%

      \[\leadsto \left|\mathsf{fma}\left(ew \cdot \sin t, \cos \tan^{-1} \left(\frac{eh}{\tan t \cdot ew}\right), \color{blue}{\frac{eh \cdot \cos t}{\mathsf{hypot}\left(1, \frac{\frac{eh}{ew}}{\tan t}\right)} \cdot \frac{\frac{eh}{ew}}{\tan t}}\right)\right| \]
    3. associate-/l/78.9%

      \[\leadsto \left|\mathsf{fma}\left(ew \cdot \sin t, \cos \tan^{-1} \left(\frac{eh}{\tan t \cdot ew}\right), \frac{eh \cdot \cos t}{\mathsf{hypot}\left(1, \color{blue}{\frac{eh}{\tan t \cdot ew}}\right)} \cdot \frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
    4. associate-/l/79.1%

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

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

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

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

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

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

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

    \[\leadsto \left|\color{blue}{-1 \cdot eh}\right| \]
  13. Step-by-step derivation
    1. neg-mul-139.9%

      \[\leadsto \left|\color{blue}{-eh}\right| \]
  14. Simplified39.9%

    \[\leadsto \left|\color{blue}{-eh}\right| \]
  15. Final simplification39.9%

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

Reproduce

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