
(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:
Herbie found 12 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(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}
(FPCore (eh ew t)
:precision binary64
(let* ((t_1 (/ (/ eh ew) (tan t))))
(fabs
(+
(/ (* ew (sin t)) (hypot 1.0 t_1))
(* (* eh (cos t)) (sin (atan t_1)))))))
double code(double eh, double ew, double t) {
double t_1 = (eh / ew) / tan(t);
return fabs((((ew * sin(t)) / hypot(1.0, t_1)) + ((eh * cos(t)) * sin(atan(t_1)))));
}
public static double code(double eh, double ew, double t) {
double t_1 = (eh / ew) / Math.tan(t);
return Math.abs((((ew * Math.sin(t)) / Math.hypot(1.0, t_1)) + ((eh * Math.cos(t)) * Math.sin(Math.atan(t_1)))));
}
def code(eh, ew, t): t_1 = (eh / ew) / math.tan(t) return math.fabs((((ew * math.sin(t)) / math.hypot(1.0, t_1)) + ((eh * math.cos(t)) * math.sin(math.atan(t_1)))))
function code(eh, ew, t) t_1 = Float64(Float64(eh / ew) / tan(t)) return abs(Float64(Float64(Float64(ew * sin(t)) / hypot(1.0, t_1)) + Float64(Float64(eh * cos(t)) * sin(atan(t_1))))) end
function tmp = code(eh, ew, t) t_1 = (eh / ew) / tan(t); tmp = abs((((ew * sin(t)) / hypot(1.0, t_1)) + ((eh * cos(t)) * sin(atan(t_1))))); end
code[eh_, ew_, t_] := Block[{t$95$1 = N[(N[(eh / ew), $MachinePrecision] / N[Tan[t], $MachinePrecision]), $MachinePrecision]}, N[Abs[N[(N[(N[(ew * N[Sin[t], $MachinePrecision]), $MachinePrecision] / N[Sqrt[1.0 ^ 2 + t$95$1 ^ 2], $MachinePrecision]), $MachinePrecision] + N[(N[(eh * N[Cos[t], $MachinePrecision]), $MachinePrecision] * N[Sin[N[ArcTan[t$95$1], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{\frac{eh}{ew}}{\tan t}\\
\left|\frac{ew \cdot \sin t}{\mathsf{hypot}\left(1, t\_1\right)} + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} t\_1\right|
\end{array}
\end{array}
Initial program 99.8%
associate-/l/99.8%
cos-atan99.8%
un-div-inv99.8%
hypot-1-def99.8%
associate-/l/99.8%
Applied egg-rr99.8%
(FPCore (eh ew t) :precision binary64 (fabs (+ (* (* eh (cos t)) (sin (atan (/ (/ eh ew) (tan t))))) (* (* ew (sin t)) (cos (atan (/ eh (* ew t))))))))
double code(double eh, double ew, double t) {
return fabs((((eh * cos(t)) * sin(atan(((eh / ew) / tan(t))))) + ((ew * sin(t)) * cos(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((((eh * cos(t)) * sin(atan(((eh / ew) / tan(t))))) + ((ew * sin(t)) * cos(atan((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) / Math.tan(t))))) + ((ew * Math.sin(t)) * Math.cos(Math.atan((eh / (ew * 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)) * math.cos(math.atan((eh / (ew * t)))))))
function code(eh, ew, t) return abs(Float64(Float64(Float64(eh * cos(t)) * sin(atan(Float64(Float64(eh / ew) / tan(t))))) + Float64(Float64(ew * sin(t)) * cos(atan(Float64(eh / Float64(ew * t))))))) end
function tmp = code(eh, ew, t) tmp = abs((((eh * cos(t)) * sin(atan(((eh / ew) / tan(t))))) + ((ew * sin(t)) * cos(atan((eh / (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[(N[(ew * N[Sin[t], $MachinePrecision]), $MachinePrecision] * N[Cos[N[ArcTan[N[(eh / N[(ew * t), $MachinePrecision]), $MachinePrecision]], $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) + \left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{eh}{ew \cdot t}\right)\right|
\end{array}
Initial program 99.8%
Taylor expanded in t around 0 99.3%
Final simplification99.3%
(FPCore (eh ew t) :precision binary64 (fabs (+ (* ew (sin t)) (* (* eh (cos t)) (sin (atan (/ (/ eh ew) (tan t))))))))
double code(double eh, double ew, double t) {
return fabs(((ew * sin(t)) + ((eh * cos(t)) * sin(atan(((eh / ew) / tan(t)))))));
}
real(8) function code(eh, ew, t)
real(8), intent (in) :: eh
real(8), intent (in) :: ew
real(8), intent (in) :: t
code = abs(((ew * sin(t)) + ((eh * cos(t)) * sin(atan(((eh / ew) / tan(t)))))))
end function
public static double code(double eh, double ew, double t) {
return Math.abs(((ew * Math.sin(t)) + ((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)) + ((eh * math.cos(t)) * math.sin(math.atan(((eh / ew) / math.tan(t)))))))
function code(eh, ew, t) return abs(Float64(Float64(ew * sin(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)) + ((eh * cos(t)) * sin(atan(((eh / ew) / tan(t))))))); end
code[eh_, ew_, t_] := N[Abs[N[(N[(ew * N[Sin[t], $MachinePrecision]), $MachinePrecision] + N[(N[(eh * N[Cos[t], $MachinePrecision]), $MachinePrecision] * N[Sin[N[ArcTan[N[(N[(eh / ew), $MachinePrecision] / N[Tan[t], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\left|ew \cdot \sin t + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right|
\end{array}
Initial program 99.8%
associate-/l/99.8%
cos-atan99.8%
un-div-inv99.8%
hypot-1-def99.8%
associate-/l/99.8%
Applied egg-rr99.8%
Taylor expanded in ew around inf 99.0%
(FPCore (eh ew t)
:precision binary64
(let* ((t_1 (atan (/ eh (* ew (tan t))))))
(if (or (<= ew -230000000.0) (not (<= ew 2.8e+18)))
(fabs (* (* ew (sin t)) (cos t_1)))
(fabs (* (cos t) (* eh (sin t_1)))))))
double code(double eh, double ew, double t) {
double t_1 = atan((eh / (ew * tan(t))));
double tmp;
if ((ew <= -230000000.0) || !(ew <= 2.8e+18)) {
tmp = fabs(((ew * sin(t)) * cos(t_1)));
} else {
tmp = fabs((cos(t) * (eh * sin(t_1))));
}
return tmp;
}
real(8) function code(eh, ew, t)
real(8), intent (in) :: eh
real(8), intent (in) :: ew
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = atan((eh / (ew * tan(t))))
if ((ew <= (-230000000.0d0)) .or. (.not. (ew <= 2.8d+18))) then
tmp = abs(((ew * sin(t)) * cos(t_1)))
else
tmp = abs((cos(t) * (eh * sin(t_1))))
end if
code = tmp
end function
public static double code(double eh, double ew, double t) {
double t_1 = Math.atan((eh / (ew * Math.tan(t))));
double tmp;
if ((ew <= -230000000.0) || !(ew <= 2.8e+18)) {
tmp = Math.abs(((ew * Math.sin(t)) * Math.cos(t_1)));
} else {
tmp = Math.abs((Math.cos(t) * (eh * Math.sin(t_1))));
}
return tmp;
}
def code(eh, ew, t): t_1 = math.atan((eh / (ew * math.tan(t)))) tmp = 0 if (ew <= -230000000.0) or not (ew <= 2.8e+18): tmp = math.fabs(((ew * math.sin(t)) * math.cos(t_1))) else: tmp = math.fabs((math.cos(t) * (eh * math.sin(t_1)))) return tmp
function code(eh, ew, t) t_1 = atan(Float64(eh / Float64(ew * tan(t)))) tmp = 0.0 if ((ew <= -230000000.0) || !(ew <= 2.8e+18)) tmp = abs(Float64(Float64(ew * sin(t)) * cos(t_1))); else tmp = abs(Float64(cos(t) * Float64(eh * sin(t_1)))); end return tmp end
function tmp_2 = code(eh, ew, t) t_1 = atan((eh / (ew * tan(t)))); tmp = 0.0; if ((ew <= -230000000.0) || ~((ew <= 2.8e+18))) tmp = abs(((ew * sin(t)) * cos(t_1))); else tmp = abs((cos(t) * (eh * sin(t_1)))); end tmp_2 = tmp; end
code[eh_, ew_, t_] := Block[{t$95$1 = N[ArcTan[N[(eh / N[(ew * N[Tan[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[Or[LessEqual[ew, -230000000.0], N[Not[LessEqual[ew, 2.8e+18]], $MachinePrecision]], N[Abs[N[(N[(ew * N[Sin[t], $MachinePrecision]), $MachinePrecision] * N[Cos[t$95$1], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Abs[N[(N[Cos[t], $MachinePrecision] * N[(eh * N[Sin[t$95$1], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \tan^{-1} \left(\frac{eh}{ew \cdot \tan t}\right)\\
\mathbf{if}\;ew \leq -230000000 \lor \neg \left(ew \leq 2.8 \cdot 10^{+18}\right):\\
\;\;\;\;\left|\left(ew \cdot \sin t\right) \cdot \cos t\_1\right|\\
\mathbf{else}:\\
\;\;\;\;\left|\cos t \cdot \left(eh \cdot \sin t\_1\right)\right|\\
\end{array}
\end{array}
if ew < -2.3e8 or 2.8e18 < ew Initial program 99.8%
fma-define99.8%
associate-/l/99.8%
associate-*l*99.8%
associate-/l/99.8%
Simplified99.8%
Taylor expanded in eh around inf 78.3%
+-commutative78.3%
associate-/l*78.1%
fma-define78.1%
*-commutative78.1%
associate-/r*78.1%
associate-/l*78.2%
Simplified78.2%
Taylor expanded in eh around 0 71.3%
*-commutative71.3%
associate-*l*71.3%
Simplified71.3%
if -2.3e8 < ew < 2.8e18Initial program 99.9%
fma-define99.9%
associate-/l/99.9%
associate-*l*99.9%
associate-/l/99.9%
Simplified99.9%
Taylor expanded in ew around 0 85.4%
*-commutative85.4%
associate-*r*85.4%
*-commutative85.4%
Simplified85.4%
Final simplification78.6%
(FPCore (eh ew t)
:precision binary64
(let* ((t_1 (/ eh (* ew (tan t)))))
(if (or (<= ew -290000000.0) (not (<= ew 5.4e+18)))
(fabs (* (* ew (sin t)) (/ 1.0 (hypot 1.0 t_1))))
(fabs (* (cos t) (* eh (sin (atan t_1))))))))
double code(double eh, double ew, double t) {
double t_1 = eh / (ew * tan(t));
double tmp;
if ((ew <= -290000000.0) || !(ew <= 5.4e+18)) {
tmp = fabs(((ew * sin(t)) * (1.0 / hypot(1.0, t_1))));
} else {
tmp = fabs((cos(t) * (eh * sin(atan(t_1)))));
}
return tmp;
}
public static double code(double eh, double ew, double t) {
double t_1 = eh / (ew * Math.tan(t));
double tmp;
if ((ew <= -290000000.0) || !(ew <= 5.4e+18)) {
tmp = Math.abs(((ew * Math.sin(t)) * (1.0 / Math.hypot(1.0, t_1))));
} else {
tmp = Math.abs((Math.cos(t) * (eh * Math.sin(Math.atan(t_1)))));
}
return tmp;
}
def code(eh, ew, t): t_1 = eh / (ew * math.tan(t)) tmp = 0 if (ew <= -290000000.0) or not (ew <= 5.4e+18): tmp = math.fabs(((ew * math.sin(t)) * (1.0 / math.hypot(1.0, t_1)))) else: tmp = math.fabs((math.cos(t) * (eh * math.sin(math.atan(t_1))))) return tmp
function code(eh, ew, t) t_1 = Float64(eh / Float64(ew * tan(t))) tmp = 0.0 if ((ew <= -290000000.0) || !(ew <= 5.4e+18)) tmp = abs(Float64(Float64(ew * sin(t)) * Float64(1.0 / hypot(1.0, t_1)))); else tmp = abs(Float64(cos(t) * Float64(eh * sin(atan(t_1))))); end return tmp end
function tmp_2 = code(eh, ew, t) t_1 = eh / (ew * tan(t)); tmp = 0.0; if ((ew <= -290000000.0) || ~((ew <= 5.4e+18))) tmp = abs(((ew * sin(t)) * (1.0 / hypot(1.0, t_1)))); else tmp = abs((cos(t) * (eh * sin(atan(t_1))))); end tmp_2 = tmp; end
code[eh_, ew_, t_] := Block[{t$95$1 = N[(eh / N[(ew * N[Tan[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[ew, -290000000.0], N[Not[LessEqual[ew, 5.4e+18]], $MachinePrecision]], N[Abs[N[(N[(ew * N[Sin[t], $MachinePrecision]), $MachinePrecision] * N[(1.0 / N[Sqrt[1.0 ^ 2 + t$95$1 ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Abs[N[(N[Cos[t], $MachinePrecision] * N[(eh * N[Sin[N[ArcTan[t$95$1], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{eh}{ew \cdot \tan t}\\
\mathbf{if}\;ew \leq -290000000 \lor \neg \left(ew \leq 5.4 \cdot 10^{+18}\right):\\
\;\;\;\;\left|\left(ew \cdot \sin t\right) \cdot \frac{1}{\mathsf{hypot}\left(1, t\_1\right)}\right|\\
\mathbf{else}:\\
\;\;\;\;\left|\cos t \cdot \left(eh \cdot \sin \tan^{-1} t\_1\right)\right|\\
\end{array}
\end{array}
if ew < -2.9e8 or 5.4e18 < ew Initial program 99.8%
fma-define99.8%
associate-/l/99.8%
associate-*l*99.8%
associate-/l/99.8%
Simplified99.8%
Taylor expanded in eh around inf 78.3%
+-commutative78.3%
associate-/l*78.1%
fma-define78.1%
*-commutative78.1%
associate-/r*78.1%
associate-/l*78.2%
Simplified78.2%
Taylor expanded in eh around 0 71.3%
*-commutative71.3%
associate-*l*71.3%
Simplified71.3%
associate-/r*71.3%
cos-atan70.9%
hypot-1-def70.9%
associate-/r*70.9%
Applied egg-rr70.9%
if -2.9e8 < ew < 5.4e18Initial program 99.9%
fma-define99.9%
associate-/l/99.9%
associate-*l*99.9%
associate-/l/99.9%
Simplified99.9%
Taylor expanded in ew around 0 85.4%
*-commutative85.4%
associate-*r*85.4%
*-commutative85.4%
Simplified85.4%
Final simplification78.5%
(FPCore (eh ew t)
:precision binary64
(let* ((t_1 (/ eh (* ew (tan t)))))
(if (or (<= t -5.8e-113) (not (<= t 1.1e-17)))
(fabs (* (* ew (sin t)) (/ 1.0 (hypot 1.0 t_1))))
(fabs (* eh (sin (atan t_1)))))))
double code(double eh, double ew, double t) {
double t_1 = eh / (ew * tan(t));
double tmp;
if ((t <= -5.8e-113) || !(t <= 1.1e-17)) {
tmp = fabs(((ew * sin(t)) * (1.0 / hypot(1.0, t_1))));
} else {
tmp = fabs((eh * sin(atan(t_1))));
}
return tmp;
}
public static double code(double eh, double ew, double t) {
double t_1 = eh / (ew * Math.tan(t));
double tmp;
if ((t <= -5.8e-113) || !(t <= 1.1e-17)) {
tmp = Math.abs(((ew * Math.sin(t)) * (1.0 / Math.hypot(1.0, t_1))));
} else {
tmp = Math.abs((eh * Math.sin(Math.atan(t_1))));
}
return tmp;
}
def code(eh, ew, t): t_1 = eh / (ew * math.tan(t)) tmp = 0 if (t <= -5.8e-113) or not (t <= 1.1e-17): tmp = math.fabs(((ew * math.sin(t)) * (1.0 / math.hypot(1.0, t_1)))) else: tmp = math.fabs((eh * math.sin(math.atan(t_1)))) return tmp
function code(eh, ew, t) t_1 = Float64(eh / Float64(ew * tan(t))) tmp = 0.0 if ((t <= -5.8e-113) || !(t <= 1.1e-17)) tmp = abs(Float64(Float64(ew * sin(t)) * Float64(1.0 / hypot(1.0, t_1)))); else tmp = abs(Float64(eh * sin(atan(t_1)))); end return tmp end
function tmp_2 = code(eh, ew, t) t_1 = eh / (ew * tan(t)); tmp = 0.0; if ((t <= -5.8e-113) || ~((t <= 1.1e-17))) tmp = abs(((ew * sin(t)) * (1.0 / hypot(1.0, t_1)))); else tmp = abs((eh * sin(atan(t_1)))); end tmp_2 = tmp; end
code[eh_, ew_, t_] := Block[{t$95$1 = N[(eh / N[(ew * N[Tan[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t, -5.8e-113], N[Not[LessEqual[t, 1.1e-17]], $MachinePrecision]], N[Abs[N[(N[(ew * N[Sin[t], $MachinePrecision]), $MachinePrecision] * N[(1.0 / N[Sqrt[1.0 ^ 2 + t$95$1 ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Abs[N[(eh * N[Sin[N[ArcTan[t$95$1], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{eh}{ew \cdot \tan t}\\
\mathbf{if}\;t \leq -5.8 \cdot 10^{-113} \lor \neg \left(t \leq 1.1 \cdot 10^{-17}\right):\\
\;\;\;\;\left|\left(ew \cdot \sin t\right) \cdot \frac{1}{\mathsf{hypot}\left(1, t\_1\right)}\right|\\
\mathbf{else}:\\
\;\;\;\;\left|eh \cdot \sin \tan^{-1} t\_1\right|\\
\end{array}
\end{array}
if t < -5.80000000000000008e-113 or 1.1e-17 < t Initial program 99.7%
fma-define99.8%
associate-/l/99.8%
associate-*l*99.8%
associate-/l/99.7%
Simplified99.7%
Taylor expanded in eh around inf 82.2%
+-commutative82.2%
associate-/l*82.1%
fma-define82.1%
*-commutative82.1%
associate-/r*82.1%
associate-/l*82.1%
Simplified82.1%
Taylor expanded in eh around 0 60.9%
*-commutative60.9%
associate-*l*60.9%
Simplified60.9%
associate-/r*60.9%
cos-atan60.6%
hypot-1-def60.6%
associate-/r*60.6%
Applied egg-rr60.6%
if -5.80000000000000008e-113 < t < 1.1e-17Initial program 100.0%
fma-define100.0%
associate-/l/100.0%
associate-*l*100.0%
associate-/l/100.0%
Simplified100.0%
Taylor expanded in t around 0 86.3%
Final simplification71.1%
(FPCore (eh ew t) :precision binary64 (if (or (<= t -5.8e-113) (not (<= t 1.9e-22))) (+ (* ew (sin t)) (* eh (sin (atan (/ (/ eh ew) (tan t)))))) (fabs (* eh (sin (atan (/ eh (* ew (tan t)))))))))
double code(double eh, double ew, double t) {
double tmp;
if ((t <= -5.8e-113) || !(t <= 1.9e-22)) {
tmp = (ew * sin(t)) + (eh * sin(atan(((eh / ew) / tan(t)))));
} else {
tmp = fabs((eh * sin(atan((eh / (ew * tan(t)))))));
}
return tmp;
}
real(8) function code(eh, ew, t)
real(8), intent (in) :: eh
real(8), intent (in) :: ew
real(8), intent (in) :: t
real(8) :: tmp
if ((t <= (-5.8d-113)) .or. (.not. (t <= 1.9d-22))) then
tmp = (ew * sin(t)) + (eh * sin(atan(((eh / ew) / tan(t)))))
else
tmp = abs((eh * sin(atan((eh / (ew * tan(t)))))))
end if
code = tmp
end function
public static double code(double eh, double ew, double t) {
double tmp;
if ((t <= -5.8e-113) || !(t <= 1.9e-22)) {
tmp = (ew * Math.sin(t)) + (eh * Math.sin(Math.atan(((eh / ew) / Math.tan(t)))));
} else {
tmp = Math.abs((eh * Math.sin(Math.atan((eh / (ew * Math.tan(t)))))));
}
return tmp;
}
def code(eh, ew, t): tmp = 0 if (t <= -5.8e-113) or not (t <= 1.9e-22): tmp = (ew * math.sin(t)) + (eh * math.sin(math.atan(((eh / ew) / math.tan(t))))) else: tmp = math.fabs((eh * math.sin(math.atan((eh / (ew * math.tan(t))))))) return tmp
function code(eh, ew, t) tmp = 0.0 if ((t <= -5.8e-113) || !(t <= 1.9e-22)) tmp = Float64(Float64(ew * sin(t)) + Float64(eh * sin(atan(Float64(Float64(eh / ew) / tan(t)))))); else tmp = abs(Float64(eh * sin(atan(Float64(eh / Float64(ew * tan(t))))))); end return tmp end
function tmp_2 = code(eh, ew, t) tmp = 0.0; if ((t <= -5.8e-113) || ~((t <= 1.9e-22))) tmp = (ew * sin(t)) + (eh * sin(atan(((eh / ew) / tan(t))))); else tmp = abs((eh * sin(atan((eh / (ew * tan(t))))))); end tmp_2 = tmp; end
code[eh_, ew_, t_] := If[Or[LessEqual[t, -5.8e-113], N[Not[LessEqual[t, 1.9e-22]], $MachinePrecision]], N[(N[(ew * N[Sin[t], $MachinePrecision]), $MachinePrecision] + N[(eh * N[Sin[N[ArcTan[N[(N[(eh / ew), $MachinePrecision] / N[Tan[t], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Abs[N[(eh * N[Sin[N[ArcTan[N[(eh / N[(ew * N[Tan[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -5.8 \cdot 10^{-113} \lor \neg \left(t \leq 1.9 \cdot 10^{-22}\right):\\
\;\;\;\;ew \cdot \sin t + eh \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\\
\mathbf{else}:\\
\;\;\;\;\left|eh \cdot \sin \tan^{-1} \left(\frac{eh}{ew \cdot \tan t}\right)\right|\\
\end{array}
\end{array}
if t < -5.80000000000000008e-113 or 1.90000000000000012e-22 < t Initial program 99.7%
fma-define99.8%
associate-/l/99.8%
associate-*l*99.8%
associate-/l/99.7%
Simplified99.7%
add-sqr-sqrt55.4%
fabs-sqr55.4%
add-sqr-sqrt56.2%
fma-undefine56.2%
associate-/l/56.2%
associate-*l*56.2%
Applied egg-rr56.2%
Taylor expanded in eh around 0 55.8%
Taylor expanded in t around 0 42.3%
associate-/r*42.3%
Simplified42.3%
if -5.80000000000000008e-113 < t < 1.90000000000000012e-22Initial program 100.0%
fma-define100.0%
associate-/l/100.0%
associate-*l*100.0%
associate-/l/100.0%
Simplified100.0%
Taylor expanded in t around 0 86.2%
Final simplification60.1%
(FPCore (eh ew t)
:precision binary64
(let* ((t_1 (/ eh (* ew (tan t)))))
(if (or (<= t -1.08e-63) (not (<= t 3.4e-16)))
(/ (* ew (sin t)) (hypot 1.0 t_1))
(fabs (* eh (sin (atan t_1)))))))
double code(double eh, double ew, double t) {
double t_1 = eh / (ew * tan(t));
double tmp;
if ((t <= -1.08e-63) || !(t <= 3.4e-16)) {
tmp = (ew * sin(t)) / hypot(1.0, t_1);
} else {
tmp = fabs((eh * sin(atan(t_1))));
}
return tmp;
}
public static double code(double eh, double ew, double t) {
double t_1 = eh / (ew * Math.tan(t));
double tmp;
if ((t <= -1.08e-63) || !(t <= 3.4e-16)) {
tmp = (ew * Math.sin(t)) / Math.hypot(1.0, t_1);
} else {
tmp = Math.abs((eh * Math.sin(Math.atan(t_1))));
}
return tmp;
}
def code(eh, ew, t): t_1 = eh / (ew * math.tan(t)) tmp = 0 if (t <= -1.08e-63) or not (t <= 3.4e-16): tmp = (ew * math.sin(t)) / math.hypot(1.0, t_1) else: tmp = math.fabs((eh * math.sin(math.atan(t_1)))) return tmp
function code(eh, ew, t) t_1 = Float64(eh / Float64(ew * tan(t))) tmp = 0.0 if ((t <= -1.08e-63) || !(t <= 3.4e-16)) tmp = Float64(Float64(ew * sin(t)) / hypot(1.0, t_1)); else tmp = abs(Float64(eh * sin(atan(t_1)))); end return tmp end
function tmp_2 = code(eh, ew, t) t_1 = eh / (ew * tan(t)); tmp = 0.0; if ((t <= -1.08e-63) || ~((t <= 3.4e-16))) tmp = (ew * sin(t)) / hypot(1.0, t_1); else tmp = abs((eh * sin(atan(t_1)))); end tmp_2 = tmp; end
code[eh_, ew_, t_] := Block[{t$95$1 = N[(eh / N[(ew * N[Tan[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t, -1.08e-63], N[Not[LessEqual[t, 3.4e-16]], $MachinePrecision]], N[(N[(ew * N[Sin[t], $MachinePrecision]), $MachinePrecision] / N[Sqrt[1.0 ^ 2 + t$95$1 ^ 2], $MachinePrecision]), $MachinePrecision], N[Abs[N[(eh * N[Sin[N[ArcTan[t$95$1], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{eh}{ew \cdot \tan t}\\
\mathbf{if}\;t \leq -1.08 \cdot 10^{-63} \lor \neg \left(t \leq 3.4 \cdot 10^{-16}\right):\\
\;\;\;\;\frac{ew \cdot \sin t}{\mathsf{hypot}\left(1, t\_1\right)}\\
\mathbf{else}:\\
\;\;\;\;\left|eh \cdot \sin \tan^{-1} t\_1\right|\\
\end{array}
\end{array}
if t < -1.07999999999999994e-63 or 3.4e-16 < t Initial program 99.7%
fma-define99.7%
associate-/l/99.7%
associate-*l*99.7%
associate-/l/99.7%
Simplified99.7%
Taylor expanded in eh around inf 82.2%
+-commutative82.2%
associate-/l*82.1%
fma-define82.1%
*-commutative82.1%
associate-/r*82.1%
associate-/l*82.1%
Simplified82.1%
Taylor expanded in eh around 0 61.1%
*-commutative61.1%
associate-*l*61.1%
Simplified61.1%
log1p-expm1-u61.0%
associate-/r*61.0%
cos-atan60.7%
hypot-1-def60.7%
div-inv60.7%
add-sqr-sqrt36.8%
fabs-sqr36.8%
add-sqr-sqrt37.3%
log1p-expm1-u37.3%
associate-/r*37.3%
Applied egg-rr37.3%
if -1.07999999999999994e-63 < t < 3.4e-16Initial program 100.0%
fma-define100.0%
associate-/l/100.0%
associate-*l*100.0%
associate-/l/100.0%
Simplified100.0%
Taylor expanded in t around 0 83.7%
Final simplification57.4%
(FPCore (eh ew t) :precision binary64 (if (or (<= t -1.08e-63) (not (<= t 1.46e-16))) (/ (* ew (sin t)) (hypot 1.0 (/ eh (* ew (tan t))))) (fabs (* eh (sin (atan (/ (/ eh ew) t)))))))
double code(double eh, double ew, double t) {
double tmp;
if ((t <= -1.08e-63) || !(t <= 1.46e-16)) {
tmp = (ew * sin(t)) / hypot(1.0, (eh / (ew * tan(t))));
} else {
tmp = fabs((eh * sin(atan(((eh / ew) / t)))));
}
return tmp;
}
public static double code(double eh, double ew, double t) {
double tmp;
if ((t <= -1.08e-63) || !(t <= 1.46e-16)) {
tmp = (ew * Math.sin(t)) / Math.hypot(1.0, (eh / (ew * Math.tan(t))));
} else {
tmp = Math.abs((eh * Math.sin(Math.atan(((eh / ew) / t)))));
}
return tmp;
}
def code(eh, ew, t): tmp = 0 if (t <= -1.08e-63) or not (t <= 1.46e-16): tmp = (ew * math.sin(t)) / math.hypot(1.0, (eh / (ew * math.tan(t)))) else: tmp = math.fabs((eh * math.sin(math.atan(((eh / ew) / t))))) return tmp
function code(eh, ew, t) tmp = 0.0 if ((t <= -1.08e-63) || !(t <= 1.46e-16)) tmp = Float64(Float64(ew * sin(t)) / hypot(1.0, Float64(eh / Float64(ew * tan(t))))); else tmp = abs(Float64(eh * sin(atan(Float64(Float64(eh / ew) / t))))); end return tmp end
function tmp_2 = code(eh, ew, t) tmp = 0.0; if ((t <= -1.08e-63) || ~((t <= 1.46e-16))) tmp = (ew * sin(t)) / hypot(1.0, (eh / (ew * tan(t)))); else tmp = abs((eh * sin(atan(((eh / ew) / t))))); end tmp_2 = tmp; end
code[eh_, ew_, t_] := If[Or[LessEqual[t, -1.08e-63], N[Not[LessEqual[t, 1.46e-16]], $MachinePrecision]], N[(N[(ew * N[Sin[t], $MachinePrecision]), $MachinePrecision] / N[Sqrt[1.0 ^ 2 + N[(eh / N[(ew * N[Tan[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision], N[Abs[N[(eh * N[Sin[N[ArcTan[N[(N[(eh / ew), $MachinePrecision] / t), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.08 \cdot 10^{-63} \lor \neg \left(t \leq 1.46 \cdot 10^{-16}\right):\\
\;\;\;\;\frac{ew \cdot \sin t}{\mathsf{hypot}\left(1, \frac{eh}{ew \cdot \tan t}\right)}\\
\mathbf{else}:\\
\;\;\;\;\left|eh \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{t}\right)\right|\\
\end{array}
\end{array}
if t < -1.07999999999999994e-63 or 1.4600000000000001e-16 < t Initial program 99.7%
fma-define99.7%
associate-/l/99.7%
associate-*l*99.7%
associate-/l/99.7%
Simplified99.7%
Taylor expanded in eh around inf 82.2%
+-commutative82.2%
associate-/l*82.1%
fma-define82.1%
*-commutative82.1%
associate-/r*82.1%
associate-/l*82.1%
Simplified82.1%
Taylor expanded in eh around 0 61.1%
*-commutative61.1%
associate-*l*61.1%
Simplified61.1%
log1p-expm1-u61.0%
associate-/r*61.0%
cos-atan60.7%
hypot-1-def60.7%
div-inv60.7%
add-sqr-sqrt36.8%
fabs-sqr36.8%
add-sqr-sqrt37.3%
log1p-expm1-u37.3%
associate-/r*37.3%
Applied egg-rr37.3%
if -1.07999999999999994e-63 < t < 1.4600000000000001e-16Initial program 100.0%
fma-define100.0%
associate-/l/100.0%
associate-*l*100.0%
associate-/l/100.0%
Simplified100.0%
Taylor expanded in t around 0 83.7%
Taylor expanded in t around 0 82.8%
Taylor expanded in t around 0 83.7%
Final simplification57.4%
(FPCore (eh ew t) :precision binary64 (fabs (* eh (sin (atan (/ (/ eh ew) t))))))
double code(double eh, double ew, double t) {
return fabs((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((eh * sin(atan(((eh / ew) / t)))))
end function
public static double code(double eh, double ew, double t) {
return Math.abs((eh * Math.sin(Math.atan(((eh / ew) / t)))));
}
def code(eh, ew, t): return math.fabs((eh * math.sin(math.atan(((eh / ew) / t)))))
function code(eh, ew, t) return abs(Float64(eh * sin(atan(Float64(Float64(eh / ew) / t))))) end
function tmp = code(eh, ew, t) tmp = abs((eh * sin(atan(((eh / ew) / t))))); end
code[eh_, ew_, t_] := N[Abs[N[(eh * N[Sin[N[ArcTan[N[(N[(eh / ew), $MachinePrecision] / t), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\left|eh \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{t}\right)\right|
\end{array}
Initial program 99.8%
fma-define99.9%
associate-/l/99.9%
associate-*l*99.9%
associate-/l/99.8%
Simplified99.8%
Taylor expanded in t around 0 44.1%
Taylor expanded in t around 0 42.6%
Taylor expanded in t around 0 42.5%
(FPCore (eh ew t)
:precision binary64
(let* ((t_1 (/ eh (* ew t))))
(if (or (<= ew -1.22e-145) (not (<= ew 2.6e-121)))
(fabs (* eh (/ eh (* (* ew t) (hypot 1.0 t_1)))))
(* eh (sin (atan t_1))))))
double code(double eh, double ew, double t) {
double t_1 = eh / (ew * t);
double tmp;
if ((ew <= -1.22e-145) || !(ew <= 2.6e-121)) {
tmp = fabs((eh * (eh / ((ew * t) * hypot(1.0, t_1)))));
} else {
tmp = eh * sin(atan(t_1));
}
return tmp;
}
public static double code(double eh, double ew, double t) {
double t_1 = eh / (ew * t);
double tmp;
if ((ew <= -1.22e-145) || !(ew <= 2.6e-121)) {
tmp = Math.abs((eh * (eh / ((ew * t) * Math.hypot(1.0, t_1)))));
} else {
tmp = eh * Math.sin(Math.atan(t_1));
}
return tmp;
}
def code(eh, ew, t): t_1 = eh / (ew * t) tmp = 0 if (ew <= -1.22e-145) or not (ew <= 2.6e-121): tmp = math.fabs((eh * (eh / ((ew * t) * math.hypot(1.0, t_1))))) else: tmp = eh * math.sin(math.atan(t_1)) return tmp
function code(eh, ew, t) t_1 = Float64(eh / Float64(ew * t)) tmp = 0.0 if ((ew <= -1.22e-145) || !(ew <= 2.6e-121)) tmp = abs(Float64(eh * Float64(eh / Float64(Float64(ew * t) * hypot(1.0, t_1))))); else tmp = Float64(eh * sin(atan(t_1))); end return tmp end
function tmp_2 = code(eh, ew, t) t_1 = eh / (ew * t); tmp = 0.0; if ((ew <= -1.22e-145) || ~((ew <= 2.6e-121))) tmp = abs((eh * (eh / ((ew * t) * hypot(1.0, t_1))))); else tmp = eh * sin(atan(t_1)); end tmp_2 = tmp; end
code[eh_, ew_, t_] := Block[{t$95$1 = N[(eh / N[(ew * t), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[ew, -1.22e-145], N[Not[LessEqual[ew, 2.6e-121]], $MachinePrecision]], N[Abs[N[(eh * N[(eh / N[(N[(ew * t), $MachinePrecision] * N[Sqrt[1.0 ^ 2 + t$95$1 ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(eh * N[Sin[N[ArcTan[t$95$1], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{eh}{ew \cdot t}\\
\mathbf{if}\;ew \leq -1.22 \cdot 10^{-145} \lor \neg \left(ew \leq 2.6 \cdot 10^{-121}\right):\\
\;\;\;\;\left|eh \cdot \frac{eh}{\left(ew \cdot t\right) \cdot \mathsf{hypot}\left(1, t\_1\right)}\right|\\
\mathbf{else}:\\
\;\;\;\;eh \cdot \sin \tan^{-1} t\_1\\
\end{array}
\end{array}
if ew < -1.2199999999999999e-145 or 2.59999999999999986e-121 < ew Initial program 99.8%
fma-define99.8%
associate-/l/99.8%
associate-*l*99.8%
associate-/l/99.8%
Simplified99.8%
Taylor expanded in t around 0 36.7%
Taylor expanded in t around 0 36.8%
Taylor expanded in t around 0 35.3%
sin-atan16.1%
associate-/l/15.4%
hypot-1-def25.9%
associate-/l/26.3%
Applied egg-rr26.3%
associate-/l/26.4%
*-commutative26.4%
*-commutative26.4%
Simplified26.4%
if -1.2199999999999999e-145 < ew < 2.59999999999999986e-121Initial program 99.9%
fma-define99.9%
associate-/l/99.9%
associate-*l*99.9%
associate-/l/99.9%
Simplified99.9%
Taylor expanded in t around 0 60.8%
Taylor expanded in t around 0 55.9%
Taylor expanded in t around 0 58.9%
add-sqr-sqrt26.9%
fabs-sqr26.9%
add-sqr-sqrt28.1%
*-commutative28.1%
associate-/l/28.1%
Applied egg-rr28.1%
Final simplification26.9%
(FPCore (eh ew t) :precision binary64 (* eh (sin (atan (/ eh (* ew t))))))
double code(double eh, double ew, double t) {
return 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 = eh * sin(atan((eh / (ew * t))))
end function
public static double code(double eh, double ew, double t) {
return eh * Math.sin(Math.atan((eh / (ew * t))));
}
def code(eh, ew, t): return eh * math.sin(math.atan((eh / (ew * t))))
function code(eh, ew, t) return Float64(eh * sin(atan(Float64(eh / Float64(ew * t))))) end
function tmp = code(eh, ew, t) tmp = eh * sin(atan((eh / (ew * t)))); end
code[eh_, ew_, t_] := N[(eh * N[Sin[N[ArcTan[N[(eh / N[(ew * t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
eh \cdot \sin \tan^{-1} \left(\frac{eh}{ew \cdot t}\right)
\end{array}
Initial program 99.8%
fma-define99.9%
associate-/l/99.9%
associate-*l*99.9%
associate-/l/99.8%
Simplified99.8%
Taylor expanded in t around 0 44.1%
Taylor expanded in t around 0 42.6%
Taylor expanded in t around 0 42.5%
add-sqr-sqrt18.3%
fabs-sqr18.3%
add-sqr-sqrt19.0%
*-commutative19.0%
associate-/l/19.0%
Applied egg-rr19.0%
Final simplification19.0%
herbie shell --seed 2024188
(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))))))))