Example from Robby

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

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

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

      \[\leadsto \left|\left(ew \cdot \sin t\right) \cdot \frac{1}{\color{blue}{\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| \]
  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|\frac{1}{\mathsf{hypot}\left(1, \frac{\frac{eh}{ew}}{\tan t}\right)} \cdot \left(ew \cdot \sin t\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]

Alternative 2: 99.1% accurate, 1.1× speedup?

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

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

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

    \[\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*89.5%

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

    \[\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.6%

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

Alternative 3: 98.5% accurate, 1.3× speedup?

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

\\
\left|\mathsf{fma}\left(ew, \sin t, \cos t \cdot \left(eh \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{\tan t}}{ew}\right)\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. associate-*l*99.8%

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

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

      \[\leadsto \left|\mathsf{fma}\left(ew, \sin t \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)\right| \]
    4. associate-/r*99.8%

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

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

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

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

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

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

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

      \[\leadsto \left|\mathsf{fma}\left(ew, e^{\log \left(\sin t \cdot \color{blue}{\frac{1}{\sqrt{1 + \frac{\frac{eh}{\tan t}}{ew} \cdot \frac{\frac{eh}{\tan t}}{ew}}}}\right)}, \cos t \cdot \left(eh \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{\tan t}}{ew}\right)\right)\right)\right| \]
    3. un-div-inv67.1%

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

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

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

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

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

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

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

Alternative 4: 98.5% accurate, 1.5× speedup?

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

\\
\left|\left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right) + ew \cdot \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. cos-atan99.8%

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

      \[\leadsto \left|\left(ew \cdot \sin t\right) \cdot \frac{1}{\color{blue}{\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| \]
  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 eh around 0 98.3%

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

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

Alternative 5: 94.3% accurate, 1.8× speedup?

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

\\
\left|ew \cdot \sin t + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(-0.3333333333333333 \cdot \frac{t \cdot eh}{ew} + \frac{eh}{ew \cdot 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. cos-atan99.8%

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

      \[\leadsto \left|\left(ew \cdot \sin t\right) \cdot \frac{1}{\color{blue}{\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| \]
  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 eh around 0 98.3%

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

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

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

Alternative 6: 90.6% accurate, 1.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := eh \cdot \cos t\\ \mathbf{if}\;ew \leq -1.05 \cdot 10^{-157} \lor \neg \left(ew \leq 4.5 \cdot 10^{-144}\right):\\ \;\;\;\;\left|ew \cdot \sin t + t_1 \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{t}}{ew}\right)\right|\\ \mathbf{else}:\\ \;\;\;\;\left|t_1 \cdot \sin \tan^{-1} \left(\frac{eh}{ew \cdot \tan t}\right)\right|\\ \end{array} \end{array} \]
(FPCore (eh ew t)
 :precision binary64
 (let* ((t_1 (* eh (cos t))))
   (if (or (<= ew -1.05e-157) (not (<= ew 4.5e-144)))
     (fabs (+ (* ew (sin t)) (* t_1 (sin (atan (/ (/ eh t) ew))))))
     (fabs (* t_1 (sin (atan (/ eh (* ew (tan t))))))))))
double code(double eh, double ew, double t) {
	double t_1 = eh * cos(t);
	double tmp;
	if ((ew <= -1.05e-157) || !(ew <= 4.5e-144)) {
		tmp = fabs(((ew * sin(t)) + (t_1 * sin(atan(((eh / t) / ew))))));
	} else {
		tmp = fabs((t_1 * sin(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) :: t_1
    real(8) :: tmp
    t_1 = eh * cos(t)
    if ((ew <= (-1.05d-157)) .or. (.not. (ew <= 4.5d-144))) then
        tmp = abs(((ew * sin(t)) + (t_1 * sin(atan(((eh / t) / ew))))))
    else
        tmp = abs((t_1 * sin(atan((eh / (ew * tan(t)))))))
    end if
    code = tmp
end function
public static double code(double eh, double ew, double t) {
	double t_1 = eh * Math.cos(t);
	double tmp;
	if ((ew <= -1.05e-157) || !(ew <= 4.5e-144)) {
		tmp = Math.abs(((ew * Math.sin(t)) + (t_1 * Math.sin(Math.atan(((eh / t) / ew))))));
	} else {
		tmp = Math.abs((t_1 * Math.sin(Math.atan((eh / (ew * Math.tan(t)))))));
	}
	return tmp;
}
def code(eh, ew, t):
	t_1 = eh * math.cos(t)
	tmp = 0
	if (ew <= -1.05e-157) or not (ew <= 4.5e-144):
		tmp = math.fabs(((ew * math.sin(t)) + (t_1 * math.sin(math.atan(((eh / t) / ew))))))
	else:
		tmp = math.fabs((t_1 * math.sin(math.atan((eh / (ew * math.tan(t)))))))
	return tmp
function code(eh, ew, t)
	t_1 = Float64(eh * cos(t))
	tmp = 0.0
	if ((ew <= -1.05e-157) || !(ew <= 4.5e-144))
		tmp = abs(Float64(Float64(ew * sin(t)) + Float64(t_1 * sin(atan(Float64(Float64(eh / t) / ew))))));
	else
		tmp = abs(Float64(t_1 * sin(atan(Float64(eh / Float64(ew * tan(t)))))));
	end
	return tmp
end
function tmp_2 = code(eh, ew, t)
	t_1 = eh * cos(t);
	tmp = 0.0;
	if ((ew <= -1.05e-157) || ~((ew <= 4.5e-144)))
		tmp = abs(((ew * sin(t)) + (t_1 * sin(atan(((eh / t) / ew))))));
	else
		tmp = abs((t_1 * sin(atan((eh / (ew * tan(t)))))));
	end
	tmp_2 = tmp;
end
code[eh_, ew_, t_] := Block[{t$95$1 = N[(eh * N[Cos[t], $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[ew, -1.05e-157], N[Not[LessEqual[ew, 4.5e-144]], $MachinePrecision]], N[Abs[N[(N[(ew * N[Sin[t], $MachinePrecision]), $MachinePrecision] + N[(t$95$1 * N[Sin[N[ArcTan[N[(N[(eh / t), $MachinePrecision] / ew), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Abs[N[(t$95$1 * N[Sin[N[ArcTan[N[(eh / N[(ew * N[Tan[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := eh \cdot \cos t\\
\mathbf{if}\;ew \leq -1.05 \cdot 10^{-157} \lor \neg \left(ew \leq 4.5 \cdot 10^{-144}\right):\\
\;\;\;\;\left|ew \cdot \sin t + t_1 \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{t}}{ew}\right)\right|\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if ew < -1.05e-157 or 4.4999999999999998e-144 < 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. cos-atan99.8%

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

        \[\leadsto \left|\left(ew \cdot \sin t\right) \cdot \frac{1}{\color{blue}{\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| \]
    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 eh around 0 98.5%

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

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

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

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

    if -1.05e-157 < ew < 4.4999999999999998e-144

    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. associate-*l*99.9%

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

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

        \[\leadsto \left|\mathsf{fma}\left(ew, \sin t \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)\right| \]
      4. associate-/r*99.9%

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

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

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

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

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

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

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

        \[\leadsto \left|\mathsf{fma}\left(ew, e^{\log \left(\sin t \cdot \color{blue}{\frac{1}{\sqrt{1 + \frac{\frac{eh}{\tan t}}{ew} \cdot \frac{\frac{eh}{\tan t}}{ew}}}}\right)}, \cos t \cdot \left(eh \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{\tan t}}{ew}\right)\right)\right)\right| \]
      3. un-div-inv77.2%

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;ew \leq -1.05 \cdot 10^{-157} \lor \neg \left(ew \leq 4.5 \cdot 10^{-144}\right):\\ \;\;\;\;\left|ew \cdot \sin t + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{t}}{ew}\right)\right|\\ \mathbf{else}:\\ \;\;\;\;\left|\left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{eh}{ew \cdot \tan t}\right)\right|\\ \end{array} \]

Alternative 7: 86.8% accurate, 1.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;ew \leq -2.65 \cdot 10^{-18} \lor \neg \left(ew \leq 7.4 \cdot 10^{-13}\right):\\ \;\;\;\;\left|ew \cdot \sin t + eh \cdot \sin \tan^{-1} \left(-0.3333333333333333 \cdot \frac{t \cdot eh}{ew} + \frac{eh}{ew \cdot t}\right)\right|\\ \mathbf{else}:\\ \;\;\;\;\left|\cos t \cdot \left(eh \cdot \sin \tan^{-1} \left(\frac{eh}{ew \cdot \tan t}\right)\right)\right|\\ \end{array} \end{array} \]
(FPCore (eh ew t)
 :precision binary64
 (if (or (<= ew -2.65e-18) (not (<= ew 7.4e-13)))
   (fabs
    (+
     (* ew (sin t))
     (*
      eh
      (sin
       (atan (+ (* -0.3333333333333333 (/ (* t eh) ew)) (/ eh (* ew t))))))))
   (fabs (* (cos t) (* eh (sin (atan (/ eh (* ew (tan t))))))))))
double code(double eh, double ew, double t) {
	double tmp;
	if ((ew <= -2.65e-18) || !(ew <= 7.4e-13)) {
		tmp = fabs(((ew * sin(t)) + (eh * sin(atan(((-0.3333333333333333 * ((t * eh) / ew)) + (eh / (ew * t))))))));
	} else {
		tmp = fabs((cos(t) * (eh * sin(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 ((ew <= (-2.65d-18)) .or. (.not. (ew <= 7.4d-13))) then
        tmp = abs(((ew * sin(t)) + (eh * sin(atan((((-0.3333333333333333d0) * ((t * eh) / ew)) + (eh / (ew * t))))))))
    else
        tmp = abs((cos(t) * (eh * sin(atan((eh / (ew * tan(t))))))))
    end if
    code = tmp
end function
public static double code(double eh, double ew, double t) {
	double tmp;
	if ((ew <= -2.65e-18) || !(ew <= 7.4e-13)) {
		tmp = Math.abs(((ew * Math.sin(t)) + (eh * Math.sin(Math.atan(((-0.3333333333333333 * ((t * eh) / ew)) + (eh / (ew * t))))))));
	} else {
		tmp = Math.abs((Math.cos(t) * (eh * Math.sin(Math.atan((eh / (ew * Math.tan(t))))))));
	}
	return tmp;
}
def code(eh, ew, t):
	tmp = 0
	if (ew <= -2.65e-18) or not (ew <= 7.4e-13):
		tmp = math.fabs(((ew * math.sin(t)) + (eh * math.sin(math.atan(((-0.3333333333333333 * ((t * eh) / ew)) + (eh / (ew * t))))))))
	else:
		tmp = math.fabs((math.cos(t) * (eh * math.sin(math.atan((eh / (ew * math.tan(t))))))))
	return tmp
function code(eh, ew, t)
	tmp = 0.0
	if ((ew <= -2.65e-18) || !(ew <= 7.4e-13))
		tmp = abs(Float64(Float64(ew * sin(t)) + Float64(eh * sin(atan(Float64(Float64(-0.3333333333333333 * Float64(Float64(t * eh) / ew)) + Float64(eh / Float64(ew * t))))))));
	else
		tmp = abs(Float64(cos(t) * Float64(eh * sin(atan(Float64(eh / Float64(ew * tan(t))))))));
	end
	return tmp
end
function tmp_2 = code(eh, ew, t)
	tmp = 0.0;
	if ((ew <= -2.65e-18) || ~((ew <= 7.4e-13)))
		tmp = abs(((ew * sin(t)) + (eh * sin(atan(((-0.3333333333333333 * ((t * eh) / ew)) + (eh / (ew * t))))))));
	else
		tmp = abs((cos(t) * (eh * sin(atan((eh / (ew * tan(t))))))));
	end
	tmp_2 = tmp;
end
code[eh_, ew_, t_] := If[Or[LessEqual[ew, -2.65e-18], N[Not[LessEqual[ew, 7.4e-13]], $MachinePrecision]], N[Abs[N[(N[(ew * N[Sin[t], $MachinePrecision]), $MachinePrecision] + N[(eh * N[Sin[N[ArcTan[N[(N[(-0.3333333333333333 * N[(N[(t * eh), $MachinePrecision] / ew), $MachinePrecision]), $MachinePrecision] + N[(eh / N[(ew * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Abs[N[(N[Cos[t], $MachinePrecision] * N[(eh * N[Sin[N[ArcTan[N[(eh / N[(ew * N[Tan[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;ew \leq -2.65 \cdot 10^{-18} \lor \neg \left(ew \leq 7.4 \cdot 10^{-13}\right):\\
\;\;\;\;\left|ew \cdot \sin t + eh \cdot \sin \tan^{-1} \left(-0.3333333333333333 \cdot \frac{t \cdot eh}{ew} + \frac{eh}{ew \cdot t}\right)\right|\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if ew < -2.65000000000000015e-18 or 7.39999999999999977e-13 < 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. cos-atan99.8%

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

        \[\leadsto \left|\left(ew \cdot \sin t\right) \cdot \frac{1}{\color{blue}{\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| \]
    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 eh around 0 98.9%

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

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

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

    if -2.65000000000000015e-18 < ew < 7.39999999999999977e-13

    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|\color{blue}{ew \cdot \left(\sin t \cdot \cos \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right)} + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
      2. fma-def99.8%

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

        \[\leadsto \left|\mathsf{fma}\left(ew, \sin t \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)\right| \]
      4. associate-/r*99.8%

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

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

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

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

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

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

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

        \[\leadsto \left|\mathsf{fma}\left(ew, e^{\log \left(\sin t \cdot \color{blue}{\frac{1}{\sqrt{1 + \frac{\frac{eh}{\tan t}}{ew} \cdot \frac{\frac{eh}{\tan t}}{ew}}}}\right)}, \cos t \cdot \left(eh \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{\tan t}}{ew}\right)\right)\right)\right| \]
      3. un-div-inv77.1%

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;ew \leq -2.65 \cdot 10^{-18} \lor \neg \left(ew \leq 7.4 \cdot 10^{-13}\right):\\ \;\;\;\;\left|ew \cdot \sin t + eh \cdot \sin \tan^{-1} \left(-0.3333333333333333 \cdot \frac{t \cdot eh}{ew} + \frac{eh}{ew \cdot t}\right)\right|\\ \mathbf{else}:\\ \;\;\;\;\left|\cos t \cdot \left(eh \cdot \sin \tan^{-1} \left(\frac{eh}{ew \cdot \tan t}\right)\right)\right|\\ \end{array} \]

Alternative 8: 86.9% accurate, 1.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;ew \leq -5 \cdot 10^{-18} \lor \neg \left(ew \leq 4.4 \cdot 10^{-18}\right):\\
\;\;\;\;\left|ew \cdot \sin t + eh \cdot \sin \tan^{-1} \left(-0.3333333333333333 \cdot \frac{t \cdot eh}{ew} + \frac{eh}{ew \cdot t}\right)\right|\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if ew < -5.00000000000000036e-18 or 4.3999999999999997e-18 < 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. cos-atan99.8%

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

        \[\leadsto \left|\left(ew \cdot \sin t\right) \cdot \frac{1}{\color{blue}{\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| \]
    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 eh around 0 98.9%

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

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

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

    if -5.00000000000000036e-18 < ew < 4.3999999999999997e-18

    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|\color{blue}{ew \cdot \left(\sin t \cdot \cos \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right)} + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
      2. fma-def99.8%

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

        \[\leadsto \left|\mathsf{fma}\left(ew, \sin t \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)\right| \]
      4. associate-/r*99.8%

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

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

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

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

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

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

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

        \[\leadsto \left|\mathsf{fma}\left(ew, e^{\log \left(\sin t \cdot \color{blue}{\frac{1}{\sqrt{1 + \frac{\frac{eh}{\tan t}}{ew} \cdot \frac{\frac{eh}{\tan t}}{ew}}}}\right)}, \cos t \cdot \left(eh \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{\tan t}}{ew}\right)\right)\right)\right| \]
      3. un-div-inv77.1%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 9: 75.1% accurate, 2.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t \leq -0.0049 \lor \neg \left(t \leq 0.04\right):\\ \;\;\;\;\left|ew \cdot \sin t\right|\\ \mathbf{else}:\\ \;\;\;\;\left|ew \cdot t + \left(eh \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right) \cdot \left(1 + t \cdot \left(t \cdot -0.5\right)\right)\right|\\ \end{array} \end{array} \]
(FPCore (eh ew t)
 :precision binary64
 (if (or (<= t -0.0049) (not (<= t 0.04)))
   (fabs (* ew (sin t)))
   (fabs
    (+
     (* ew t)
     (* (* eh (sin (atan (/ (/ eh ew) (tan t))))) (+ 1.0 (* t (* t -0.5))))))))
double code(double eh, double ew, double t) {
	double tmp;
	if ((t <= -0.0049) || !(t <= 0.04)) {
		tmp = fabs((ew * sin(t)));
	} else {
		tmp = fabs(((ew * t) + ((eh * sin(atan(((eh / ew) / tan(t))))) * (1.0 + (t * (t * -0.5))))));
	}
	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 <= (-0.0049d0)) .or. (.not. (t <= 0.04d0))) then
        tmp = abs((ew * sin(t)))
    else
        tmp = abs(((ew * t) + ((eh * sin(atan(((eh / ew) / tan(t))))) * (1.0d0 + (t * (t * (-0.5d0)))))))
    end if
    code = tmp
end function
public static double code(double eh, double ew, double t) {
	double tmp;
	if ((t <= -0.0049) || !(t <= 0.04)) {
		tmp = Math.abs((ew * Math.sin(t)));
	} else {
		tmp = Math.abs(((ew * t) + ((eh * Math.sin(Math.atan(((eh / ew) / Math.tan(t))))) * (1.0 + (t * (t * -0.5))))));
	}
	return tmp;
}
def code(eh, ew, t):
	tmp = 0
	if (t <= -0.0049) or not (t <= 0.04):
		tmp = math.fabs((ew * math.sin(t)))
	else:
		tmp = math.fabs(((ew * t) + ((eh * math.sin(math.atan(((eh / ew) / math.tan(t))))) * (1.0 + (t * (t * -0.5))))))
	return tmp
function code(eh, ew, t)
	tmp = 0.0
	if ((t <= -0.0049) || !(t <= 0.04))
		tmp = abs(Float64(ew * sin(t)));
	else
		tmp = abs(Float64(Float64(ew * t) + Float64(Float64(eh * sin(atan(Float64(Float64(eh / ew) / tan(t))))) * Float64(1.0 + Float64(t * Float64(t * -0.5))))));
	end
	return tmp
end
function tmp_2 = code(eh, ew, t)
	tmp = 0.0;
	if ((t <= -0.0049) || ~((t <= 0.04)))
		tmp = abs((ew * sin(t)));
	else
		tmp = abs(((ew * t) + ((eh * sin(atan(((eh / ew) / tan(t))))) * (1.0 + (t * (t * -0.5))))));
	end
	tmp_2 = tmp;
end
code[eh_, ew_, t_] := If[Or[LessEqual[t, -0.0049], N[Not[LessEqual[t, 0.04]], $MachinePrecision]], N[Abs[N[(ew * N[Sin[t], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Abs[N[(N[(ew * t), $MachinePrecision] + N[(N[(eh * N[Sin[N[ArcTan[N[(N[(eh / ew), $MachinePrecision] / N[Tan[t], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 + N[(t * N[(t * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;t \leq -0.0049 \lor \neg \left(t \leq 0.04\right):\\
\;\;\;\;\left|ew \cdot \sin t\right|\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -0.0048999999999999998 or 0.0400000000000000008 < t

    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. associate-*l*99.7%

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

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

        \[\leadsto \left|\mathsf{fma}\left(ew, \sin t \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)\right| \]
      4. associate-/r*99.7%

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

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

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

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

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

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

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

        \[\leadsto \left|\mathsf{fma}\left(ew, e^{\log \left(\sin t \cdot \color{blue}{\frac{1}{\sqrt{1 + \frac{\frac{eh}{\tan t}}{ew} \cdot \frac{\frac{eh}{\tan t}}{ew}}}}\right)}, \cos t \cdot \left(eh \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{\tan t}}{ew}\right)\right)\right)\right| \]
      3. un-div-inv58.8%

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

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

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

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

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

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

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

    if -0.0048999999999999998 < t < 0.0400000000000000008

    1. Initial program 100.0%

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

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

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

        \[\leadsto \left|\mathsf{fma}\left(ew, \sin t \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)\right| \]
      4. associate-/r*100.0%

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

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

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

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

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

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

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

        \[\leadsto \left|\mathsf{fma}\left(ew, e^{\log \left(\sin t \cdot \color{blue}{\frac{1}{\sqrt{1 + \frac{\frac{eh}{\tan t}}{ew} \cdot \frac{\frac{eh}{\tan t}}{ew}}}}\right)}, \cos t \cdot \left(eh \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{\tan t}}{ew}\right)\right)\right)\right| \]
      3. un-div-inv76.2%

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

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

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

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

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

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

      \[\leadsto \left|\color{blue}{\sin \tan^{-1} \left(\frac{eh}{\tan t \cdot ew}\right) \cdot eh + \left(-0.5 \cdot \left({t}^{2} \cdot \left(\sin \tan^{-1} \left(\frac{eh}{\tan t \cdot ew}\right) \cdot eh\right)\right) + t \cdot ew\right)}\right| \]
    8. Step-by-step derivation
      1. associate-+r+99.3%

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

        \[\leadsto \left|\color{blue}{t \cdot ew + \left(\sin \tan^{-1} \left(\frac{eh}{\tan t \cdot ew}\right) \cdot eh + -0.5 \cdot \left({t}^{2} \cdot \left(\sin \tan^{-1} \left(\frac{eh}{\tan t \cdot ew}\right) \cdot eh\right)\right)\right)}\right| \]
      3. *-lft-identity99.3%

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

        \[\leadsto \left|t \cdot ew + \left(1 \cdot \left(\sin \tan^{-1} \left(\frac{eh}{\tan t \cdot ew}\right) \cdot eh\right) + \color{blue}{\left(-0.5 \cdot {t}^{2}\right) \cdot \left(\sin \tan^{-1} \left(\frac{eh}{\tan t \cdot ew}\right) \cdot eh\right)}\right)\right| \]
      5. distribute-rgt-out99.3%

        \[\leadsto \left|t \cdot ew + \color{blue}{\left(\sin \tan^{-1} \left(\frac{eh}{\tan t \cdot ew}\right) \cdot eh\right) \cdot \left(1 + -0.5 \cdot {t}^{2}\right)}\right| \]
      6. *-commutative99.3%

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

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

        \[\leadsto \left|t \cdot ew + \left(eh \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right) \cdot \left(1 + -0.5 \cdot \color{blue}{\left(t \cdot t\right)}\right)\right| \]
      9. associate-*r*99.3%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -0.0049 \lor \neg \left(t \leq 0.04\right):\\ \;\;\;\;\left|ew \cdot \sin t\right|\\ \mathbf{else}:\\ \;\;\;\;\left|ew \cdot t + \left(eh \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right) \cdot \left(1 + t \cdot \left(t \cdot -0.5\right)\right)\right|\\ \end{array} \]

Alternative 10: 76.6% accurate, 2.2× speedup?

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

\\
\left|ew \cdot \sin t + eh \cdot \sin \tan^{-1} \left(-0.3333333333333333 \cdot \frac{t \cdot eh}{ew} + \frac{eh}{ew \cdot 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. cos-atan99.8%

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

      \[\leadsto \left|\left(ew \cdot \sin t\right) \cdot \frac{1}{\color{blue}{\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| \]
  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 eh around 0 98.3%

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

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

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

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

Alternative 11: 74.9% accurate, 2.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t \leq -0.0125 \lor \neg \left(t \leq 0.0015\right):\\ \;\;\;\;\left|ew \cdot \sin t\right|\\ \mathbf{else}:\\ \;\;\;\;\left|ew \cdot t + eh \cdot \sin \tan^{-1} \left(\frac{eh}{ew \cdot \tan t}\right)\right|\\ \end{array} \end{array} \]
(FPCore (eh ew t)
 :precision binary64
 (if (or (<= t -0.0125) (not (<= t 0.0015)))
   (fabs (* ew (sin t)))
   (fabs (+ (* ew t) (* eh (sin (atan (/ eh (* ew (tan t))))))))))
double code(double eh, double ew, double t) {
	double tmp;
	if ((t <= -0.0125) || !(t <= 0.0015)) {
		tmp = fabs((ew * sin(t)));
	} else {
		tmp = fabs(((ew * t) + (eh * sin(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 <= (-0.0125d0)) .or. (.not. (t <= 0.0015d0))) then
        tmp = abs((ew * sin(t)))
    else
        tmp = abs(((ew * t) + (eh * sin(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 <= -0.0125) || !(t <= 0.0015)) {
		tmp = Math.abs((ew * Math.sin(t)));
	} else {
		tmp = Math.abs(((ew * t) + (eh * Math.sin(Math.atan((eh / (ew * Math.tan(t))))))));
	}
	return tmp;
}
def code(eh, ew, t):
	tmp = 0
	if (t <= -0.0125) or not (t <= 0.0015):
		tmp = math.fabs((ew * math.sin(t)))
	else:
		tmp = math.fabs(((ew * t) + (eh * math.sin(math.atan((eh / (ew * math.tan(t))))))))
	return tmp
function code(eh, ew, t)
	tmp = 0.0
	if ((t <= -0.0125) || !(t <= 0.0015))
		tmp = abs(Float64(ew * sin(t)));
	else
		tmp = abs(Float64(Float64(ew * t) + Float64(eh * sin(atan(Float64(eh / Float64(ew * tan(t))))))));
	end
	return tmp
end
function tmp_2 = code(eh, ew, t)
	tmp = 0.0;
	if ((t <= -0.0125) || ~((t <= 0.0015)))
		tmp = abs((ew * sin(t)));
	else
		tmp = abs(((ew * t) + (eh * sin(atan((eh / (ew * tan(t))))))));
	end
	tmp_2 = tmp;
end
code[eh_, ew_, t_] := If[Or[LessEqual[t, -0.0125], N[Not[LessEqual[t, 0.0015]], $MachinePrecision]], N[Abs[N[(ew * N[Sin[t], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Abs[N[(N[(ew * t), $MachinePrecision] + N[(eh * N[Sin[N[ArcTan[N[(eh / N[(ew * N[Tan[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;t \leq -0.0125 \lor \neg \left(t \leq 0.0015\right):\\
\;\;\;\;\left|ew \cdot \sin t\right|\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -0.012500000000000001 or 0.0015 < t

    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. associate-*l*99.7%

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

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

        \[\leadsto \left|\mathsf{fma}\left(ew, \sin t \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)\right| \]
      4. associate-/r*99.7%

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

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

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

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

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

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

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

        \[\leadsto \left|\mathsf{fma}\left(ew, e^{\log \left(\sin t \cdot \color{blue}{\frac{1}{\sqrt{1 + \frac{\frac{eh}{\tan t}}{ew} \cdot \frac{\frac{eh}{\tan t}}{ew}}}}\right)}, \cos t \cdot \left(eh \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{\tan t}}{ew}\right)\right)\right)\right| \]
      3. un-div-inv58.8%

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

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

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

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

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

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

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

    if -0.012500000000000001 < t < 0.0015

    1. Initial program 100.0%

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

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

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

        \[\leadsto \left|\mathsf{fma}\left(ew, \sin t \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)\right| \]
      4. associate-/r*100.0%

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

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

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

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

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

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

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

        \[\leadsto \left|\mathsf{fma}\left(ew, e^{\log \left(\sin t \cdot \color{blue}{\frac{1}{\sqrt{1 + \frac{\frac{eh}{\tan t}}{ew} \cdot \frac{\frac{eh}{\tan t}}{ew}}}}\right)}, \cos t \cdot \left(eh \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{\tan t}}{ew}\right)\right)\right)\right| \]
      3. un-div-inv76.2%

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -0.0125 \lor \neg \left(t \leq 0.0015\right):\\ \;\;\;\;\left|ew \cdot \sin t\right|\\ \mathbf{else}:\\ \;\;\;\;\left|ew \cdot t + eh \cdot \sin \tan^{-1} \left(\frac{eh}{ew \cdot \tan t}\right)\right|\\ \end{array} \]

Alternative 12: 61.5% accurate, 2.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t \leq -6 \cdot 10^{-25} \lor \neg \left(t \leq 4.2 \cdot 10^{-62}\right):\\ \;\;\;\;\left|ew \cdot \sin t\right|\\ \mathbf{else}:\\ \;\;\;\;\left|eh \cdot \sin \tan^{-1} \left(\frac{eh}{ew \cdot \tan t}\right)\right|\\ \end{array} \end{array} \]
(FPCore (eh ew t)
 :precision binary64
 (if (or (<= t -6e-25) (not (<= t 4.2e-62)))
   (fabs (* ew (sin t)))
   (fabs (* eh (sin (atan (/ eh (* ew (tan t)))))))))
double code(double eh, double ew, double t) {
	double tmp;
	if ((t <= -6e-25) || !(t <= 4.2e-62)) {
		tmp = fabs((ew * sin(t)));
	} else {
		tmp = fabs((eh * sin(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 <= (-6d-25)) .or. (.not. (t <= 4.2d-62))) then
        tmp = abs((ew * sin(t)))
    else
        tmp = abs((eh * sin(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 <= -6e-25) || !(t <= 4.2e-62)) {
		tmp = Math.abs((ew * Math.sin(t)));
	} else {
		tmp = Math.abs((eh * Math.sin(Math.atan((eh / (ew * Math.tan(t)))))));
	}
	return tmp;
}
def code(eh, ew, t):
	tmp = 0
	if (t <= -6e-25) or not (t <= 4.2e-62):
		tmp = math.fabs((ew * math.sin(t)))
	else:
		tmp = math.fabs((eh * math.sin(math.atan((eh / (ew * math.tan(t)))))))
	return tmp
function code(eh, ew, t)
	tmp = 0.0
	if ((t <= -6e-25) || !(t <= 4.2e-62))
		tmp = abs(Float64(ew * sin(t)));
	else
		tmp = abs(Float64(eh * sin(atan(Float64(eh / Float64(ew * tan(t)))))));
	end
	return tmp
end
function tmp_2 = code(eh, ew, t)
	tmp = 0.0;
	if ((t <= -6e-25) || ~((t <= 4.2e-62)))
		tmp = abs((ew * sin(t)));
	else
		tmp = abs((eh * sin(atan((eh / (ew * tan(t)))))));
	end
	tmp_2 = tmp;
end
code[eh_, ew_, t_] := If[Or[LessEqual[t, -6e-25], N[Not[LessEqual[t, 4.2e-62]], $MachinePrecision]], N[Abs[N[(ew * N[Sin[t], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Abs[N[(eh * N[Sin[N[ArcTan[N[(eh / N[(ew * N[Tan[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;t \leq -6 \cdot 10^{-25} \lor \neg \left(t \leq 4.2 \cdot 10^{-62}\right):\\
\;\;\;\;\left|ew \cdot \sin t\right|\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -5.9999999999999995e-25 or 4.1999999999999998e-62 < t

    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. associate-*l*99.7%

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

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

        \[\leadsto \left|\mathsf{fma}\left(ew, \sin t \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)\right| \]
      4. associate-/r*99.7%

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

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

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

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

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

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

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

        \[\leadsto \left|\mathsf{fma}\left(ew, e^{\log \left(\sin t \cdot \color{blue}{\frac{1}{\sqrt{1 + \frac{\frac{eh}{\tan t}}{ew} \cdot \frac{\frac{eh}{\tan t}}{ew}}}}\right)}, \cos t \cdot \left(eh \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{\tan t}}{ew}\right)\right)\right)\right| \]
      3. un-div-inv60.8%

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

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

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

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

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

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

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

    if -5.9999999999999995e-25 < t < 4.1999999999999998e-62

    1. Initial program 100.0%

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

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

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

        \[\leadsto \left|\mathsf{fma}\left(ew, \sin t \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)\right| \]
      4. associate-/r*100.0%

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

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

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

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

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

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

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

        \[\leadsto \left|\mathsf{fma}\left(ew, e^{\log \left(\sin t \cdot \color{blue}{\frac{1}{\sqrt{1 + \frac{\frac{eh}{\tan t}}{ew} \cdot \frac{\frac{eh}{\tan t}}{ew}}}}\right)}, \cos t \cdot \left(eh \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{\tan t}}{ew}\right)\right)\right)\right| \]
      3. un-div-inv75.9%

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

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

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

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

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

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

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

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

Alternative 13: 41.9% accurate, 4.5× speedup?

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

\\
\left|ew \cdot \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|\color{blue}{ew \cdot \left(\sin t \cdot \cos \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right)} + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
    2. fma-def99.8%

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

      \[\leadsto \left|\mathsf{fma}\left(ew, \sin t \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)\right| \]
    4. associate-/r*99.8%

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

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

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

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

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

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

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

      \[\leadsto \left|\mathsf{fma}\left(ew, e^{\log \left(\sin t \cdot \color{blue}{\frac{1}{\sqrt{1 + \frac{\frac{eh}{\tan t}}{ew} \cdot \frac{\frac{eh}{\tan t}}{ew}}}}\right)}, \cos t \cdot \left(eh \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{\tan t}}{ew}\right)\right)\right)\right| \]
    3. un-div-inv67.1%

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

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

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

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

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

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

    \[\leadsto \left|\color{blue}{\sin t \cdot ew}\right| \]
  8. Final simplification41.2%

    \[\leadsto \left|ew \cdot \sin t\right| \]

Reproduce

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