Example from Robby

Percentage Accurate: 99.8% → 99.8%
Time: 20.9s
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, 0.9× speedup?

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

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

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

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

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

    \[\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. Final simplification99.9%

    \[\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} \left(\frac{\frac{eh}{\tan t}}{ew}\right)\right)\right)\right| \]

Alternative 2: 99.8% accurate, 1.1× speedup?

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

\\
\left|ew \cdot \frac{\sin t}{\mathsf{hypot}\left(1, \frac{eh}{ew \cdot \tan t}\right)} + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right|
\end{array}
Derivation
  1. Initial program 99.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. expm1-log1p-u78.9%

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

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

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

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

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

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

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

    \[\leadsto \left|\color{blue}{\left(e^{\mathsf{log1p}\left(ew \cdot \frac{\sin t}{\mathsf{hypot}\left(1, \frac{eh}{ew \cdot \tan t}\right)}\right)} - 1\right)} + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
  4. Step-by-step derivation
    1. expm1-def82.4%

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

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

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

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

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

Alternative 3: 99.0% 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{eh}{ew \cdot t}\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 (* ew t)))) (* 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 / (ew * 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))))) + (cos(atan((eh / (ew * 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))))) + (Math.cos(Math.atan((eh / (ew * 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))))) + (math.cos(math.atan((eh / (ew * 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(cos(atan(Float64(eh / Float64(ew * t)))) * 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 / (ew * 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[(N[Cos[N[ArcTan[N[(eh / N[(ew * t), $MachinePrecision]), $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{eh}{ew \cdot t}\right) \cdot \left(ew \cdot \sin t\right)\right|
\end{array}
Derivation
  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. Taylor expanded in t around 0 99.2%

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

    \[\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{eh}{ew \cdot t}\right) \cdot \left(ew \cdot \sin t\right)\right| \]

Alternative 4: 98.4% 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.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. expm1-log1p-u78.9%

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

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

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

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

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

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

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

    \[\leadsto \left|\color{blue}{\left(e^{\mathsf{log1p}\left(ew \cdot \frac{\sin t}{\mathsf{hypot}\left(1, \frac{eh}{ew \cdot \tan t}\right)}\right)} - 1\right)} + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
  4. Step-by-step derivation
    1. expm1-def82.4%

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

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

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

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

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

    \[\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: 90.2% accurate, 1.7× speedup?

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

\\
\begin{array}{l}
t_1 := eh \cdot \cos t\\
\mathbf{if}\;eh \leq -8 \cdot 10^{+148} \lor \neg \left(eh \leq 6.8 \cdot 10^{+72}\right):\\
\;\;\;\;\left|t_1 \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right) + \frac{1}{0.16666666666666666 \cdot \frac{t}{ew} + \frac{1}{ew \cdot t}}\right|\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if eh < -8.0000000000000004e148 or 6.7999999999999997e72 < eh

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

      \[\leadsto \left|\color{blue}{\left(e^{\mathsf{log1p}\left(ew \cdot \frac{\sin t}{\mathsf{hypot}\left(1, \frac{eh}{ew \cdot \tan t}\right)}\right)} - 1\right)} + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
    4. Step-by-step derivation
      1. expm1-def86.3%

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

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

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

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

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

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

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

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

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

    if -8.0000000000000004e148 < eh < 6.7999999999999997e72

    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. expm1-log1p-u80.4%

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

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

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

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

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

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

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

      \[\leadsto \left|\color{blue}{\left(e^{\mathsf{log1p}\left(ew \cdot \frac{\sin t}{\mathsf{hypot}\left(1, \frac{eh}{ew \cdot \tan t}\right)}\right)} - 1\right)} + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
    4. Step-by-step derivation
      1. expm1-def80.4%

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

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

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

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

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

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

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

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

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

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

Alternative 6: 83.0% accurate, 1.8× speedup?

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

\\
\begin{array}{l}
t_1 := \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\\
\mathbf{if}\;ew \leq -3.05 \cdot 10^{-139} \lor \neg \left(ew \leq 6.1 \cdot 10^{-173}\right):\\
\;\;\;\;\left|\frac{1}{\frac{1}{ew \cdot \sin t}} + eh \cdot t_1\right|\\

\mathbf{else}:\\
\;\;\;\;\left|\left(eh \cdot \cos t\right) \cdot t_1 + ew \cdot t\right|\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if ew < -3.0499999999999999e-139 or 6.0999999999999998e-173 < 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. expm1-log1p-u72.0%

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

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

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

        \[\leadsto \left|\left(e^{\mathsf{log1p}\left(ew \cdot \left(\sin t \cdot \color{blue}{\frac{1}{\sqrt{1 + \frac{\frac{eh}{ew}}{\tan t} \cdot \frac{\frac{eh}{ew}}{\tan t}}}}\right)\right)} - 1\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
      5. un-div-inv66.4%

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

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

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

      \[\leadsto \left|\color{blue}{\left(e^{\mathsf{log1p}\left(ew \cdot \frac{\sin t}{\mathsf{hypot}\left(1, \frac{eh}{ew \cdot \tan t}\right)}\right)} - 1\right)} + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
    4. Step-by-step derivation
      1. expm1-def76.7%

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

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

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

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

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

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

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

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

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

    if -3.0499999999999999e-139 < ew < 6.0999999999999998e-173

    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. expm1-log1p-u99.9%

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

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

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

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

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

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

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

      \[\leadsto \left|\color{blue}{\left(e^{\mathsf{log1p}\left(ew \cdot \frac{\sin t}{\mathsf{hypot}\left(1, \frac{eh}{ew \cdot \tan t}\right)}\right)} - 1\right)} + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
    4. Step-by-step derivation
      1. expm1-def99.9%

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

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

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

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

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

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

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

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

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

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

Alternative 7: 89.1% accurate, 1.8× speedup?

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

\\
\left|\frac{1}{\frac{1}{ew \cdot \sin t}} + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{eh}{ew \cdot t}\right)\right|
\end{array}
Derivation
  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. expm1-log1p-u78.9%

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

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

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

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

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

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

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

    \[\leadsto \left|\color{blue}{\left(e^{\mathsf{log1p}\left(ew \cdot \frac{\sin t}{\mathsf{hypot}\left(1, \frac{eh}{ew \cdot \tan t}\right)}\right)} - 1\right)} + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
  4. Step-by-step derivation
    1. expm1-def82.4%

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

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

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

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

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

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

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

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

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

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

Alternative 8: 65.7% accurate, 1.8× 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 t\right| \end{array} \]
(FPCore (eh ew t)
 :precision binary64
 (fabs (+ (* (* eh (cos t)) (sin (atan (/ (/ eh ew) (tan t))))) (* ew t))))
double code(double eh, double ew, double t) {
	return fabs((((eh * cos(t)) * sin(atan(((eh / ew) / tan(t))))) + (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((((eh * cos(t)) * sin(atan(((eh / ew) / tan(t))))) + (ew * 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 * t)));
}
def code(eh, ew, t):
	return math.fabs((((eh * math.cos(t)) * math.sin(math.atan(((eh / ew) / math.tan(t))))) + (ew * t)))
function code(eh, ew, t)
	return abs(Float64(Float64(Float64(eh * cos(t)) * sin(atan(Float64(Float64(eh / ew) / tan(t))))) + Float64(ew * t)))
end
function tmp = code(eh, ew, t)
	tmp = abs((((eh * cos(t)) * sin(atan(((eh / ew) / tan(t))))) + (ew * 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 * t), $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 t\right|
\end{array}
Derivation
  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. expm1-log1p-u78.9%

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

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

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

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

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

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

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

    \[\leadsto \left|\color{blue}{\left(e^{\mathsf{log1p}\left(ew \cdot \frac{\sin t}{\mathsf{hypot}\left(1, \frac{eh}{ew \cdot \tan t}\right)}\right)} - 1\right)} + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
  4. Step-by-step derivation
    1. expm1-def82.4%

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

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

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

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

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

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

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

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

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

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

Alternative 9: 52.2% accurate, 2.2× speedup?

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

\\
\left|\left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{eh}{ew \cdot t}\right) + ew \cdot \left(t \cdot \frac{1}{\frac{\frac{eh}{ew}}{t}}\right)\right|
\end{array}
Derivation
  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. expm1-log1p-u78.9%

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

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

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

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

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

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

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

    \[\leadsto \left|\color{blue}{\left(e^{\mathsf{log1p}\left(ew \cdot \frac{\sin t}{\mathsf{hypot}\left(1, \frac{eh}{ew \cdot \tan t}\right)}\right)} - 1\right)} + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
  4. Step-by-step derivation
    1. expm1-def82.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 10: 46.7% accurate, 2.2× speedup?

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

\\
\left|\left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{eh}{ew \cdot t}\right) + ew \cdot \frac{t \cdot t}{\frac{eh}{ew}}\right|
\end{array}
Derivation
  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. expm1-log1p-u78.9%

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

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

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

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

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

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

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

    \[\leadsto \left|\color{blue}{\left(e^{\mathsf{log1p}\left(ew \cdot \frac{\sin t}{\mathsf{hypot}\left(1, \frac{eh}{ew \cdot \tan t}\right)}\right)} - 1\right)} + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
  4. Step-by-step derivation
    1. expm1-def82.4%

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

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

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

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

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

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

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

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

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

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

Alternative 11: 40.4% accurate, 2.2× speedup?

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

\\
\left|eh \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right) + ew \cdot \left(t \cdot \left(ew \cdot \frac{t}{eh}\right)\right)\right|
\end{array}
Derivation
  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. expm1-log1p-u78.9%

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

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

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

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

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

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

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

    \[\leadsto \left|\color{blue}{\left(e^{\mathsf{log1p}\left(ew \cdot \frac{\sin t}{\mathsf{hypot}\left(1, \frac{eh}{ew \cdot \tan t}\right)}\right)} - 1\right)} + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
  4. Step-by-step derivation
    1. expm1-def82.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 12: 40.4% accurate, 2.2× speedup?

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

\\
\left|eh \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right) + ew \cdot \left(t \cdot \frac{t}{\frac{eh}{ew}}\right)\right|
\end{array}
Derivation
  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. expm1-log1p-u78.9%

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

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

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

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

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

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

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

    \[\leadsto \left|\color{blue}{\left(e^{\mathsf{log1p}\left(ew \cdot \frac{\sin t}{\mathsf{hypot}\left(1, \frac{eh}{ew \cdot \tan t}\right)}\right)} - 1\right)} + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
  4. Step-by-step derivation
    1. expm1-def82.4%

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

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

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

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

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

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

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

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

    \[\leadsto \left|ew \cdot \frac{t \cdot t}{\frac{eh}{ew}} + \color{blue}{eh} \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
  10. Step-by-step derivation
    1. expm1-log1p-u40.3%

      \[\leadsto \left|\color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(ew \cdot \frac{t \cdot t}{\frac{eh}{ew}}\right)\right)} + eh \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
    2. expm1-udef40.4%

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

      \[\leadsto \left|\left(e^{\mathsf{log1p}\left(\color{blue}{\frac{ew \cdot \left(t \cdot t\right)}{\frac{eh}{ew}}}\right)} - 1\right) + eh \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
  11. Applied egg-rr40.4%

    \[\leadsto \left|\color{blue}{\left(e^{\mathsf{log1p}\left(\frac{ew \cdot \left(t \cdot t\right)}{\frac{eh}{ew}}\right)} - 1\right)} + eh \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
  12. Step-by-step derivation
    1. expm1-def40.3%

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

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

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

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

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

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

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

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

Alternative 13: 39.2% accurate, 2.9× speedup?

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

\\
\left|ew \cdot \frac{t \cdot t}{\frac{eh}{ew}} + eh \cdot \sin \tan^{-1} \left(\frac{eh}{ew \cdot t}\right)\right|
\end{array}
Derivation
  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. expm1-log1p-u78.9%

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

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

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

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

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

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

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

    \[\leadsto \left|\color{blue}{\left(e^{\mathsf{log1p}\left(ew \cdot \frac{\sin t}{\mathsf{hypot}\left(1, \frac{eh}{ew \cdot \tan t}\right)}\right)} - 1\right)} + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
  4. Step-by-step derivation
    1. expm1-def82.4%

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

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

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

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

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

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

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

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

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

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

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

Reproduce

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