
(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 16 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 (atan (/ eh (* ew (tan t)))))) (fabs (fma 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(fma(ew, (sin(t) * cos(t_1)), (eh * (cos(t) * sin(t_1)))));
}
function code(eh, ew, t) t_1 = atan(Float64(eh / Float64(ew * tan(t)))) return abs(fma(ew, Float64(sin(t) * cos(t_1)), Float64(eh * Float64(cos(t) * sin(t_1))))) end
code[eh_, ew_, t_] := Block[{t$95$1 = N[ArcTan[N[(eh / N[(ew * N[Tan[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, N[Abs[N[(ew * N[(N[Sin[t], $MachinePrecision] * N[Cos[t$95$1], $MachinePrecision]), $MachinePrecision] + N[(eh * N[(N[Cos[t], $MachinePrecision] * N[Sin[t$95$1], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \tan^{-1} \left(\frac{eh}{ew \cdot \tan t}\right)\\
\left|\mathsf{fma}\left(ew, \sin t \cdot \cos t\_1, eh \cdot \left(\cos t \cdot \sin t\_1\right)\right)\right|
\end{array}
\end{array}
Initial program 99.8%
associate-*l*99.8%
fma-define99.8%
associate-/r*99.8%
associate-*l*99.8%
associate-/r*99.8%
Simplified99.8%
(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(Float64(ew * 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[(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[(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|\frac{ew \cdot \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}
Initial program 99.8%
associate-/r*99.8%
cos-atan99.8%
un-div-inv99.8%
hypot-1-def99.8%
Applied egg-rr99.8%
(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-/r*99.8%
cos-atan99.8%
un-div-inv99.8%
hypot-1-def99.8%
Applied egg-rr99.8%
Taylor expanded in ew around inf 98.2%
(FPCore (eh ew t)
:precision binary64
(let* ((t_1 (atan (/ (/ eh ew) (tan t))))
(t_2 (fabs (* (* ew (sin t)) (cos t_1)))))
(if (<= ew -8.8e+47)
t_2
(if (<= ew 2.25e-14)
(fabs (* eh (* (cos t) (sin t_1))))
(if (or (<= ew 2.1e+56) (not (<= ew 1.55e+86)))
t_2
(fabs
(*
eh
(*
(cos t)
(sin
(atan
(/
(+ (/ eh ew) (* -0.3333333333333333 (/ (* eh (pow t 2.0)) ew)))
t)))))))))))
double code(double eh, double ew, double t) {
double t_1 = atan(((eh / ew) / tan(t)));
double t_2 = fabs(((ew * sin(t)) * cos(t_1)));
double tmp;
if (ew <= -8.8e+47) {
tmp = t_2;
} else if (ew <= 2.25e-14) {
tmp = fabs((eh * (cos(t) * sin(t_1))));
} else if ((ew <= 2.1e+56) || !(ew <= 1.55e+86)) {
tmp = t_2;
} else {
tmp = fabs((eh * (cos(t) * sin(atan((((eh / ew) + (-0.3333333333333333 * ((eh * pow(t, 2.0)) / 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) :: t_2
real(8) :: tmp
t_1 = atan(((eh / ew) / tan(t)))
t_2 = abs(((ew * sin(t)) * cos(t_1)))
if (ew <= (-8.8d+47)) then
tmp = t_2
else if (ew <= 2.25d-14) then
tmp = abs((eh * (cos(t) * sin(t_1))))
else if ((ew <= 2.1d+56) .or. (.not. (ew <= 1.55d+86))) then
tmp = t_2
else
tmp = abs((eh * (cos(t) * sin(atan((((eh / ew) + ((-0.3333333333333333d0) * ((eh * (t ** 2.0d0)) / ew))) / t))))))
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 t_2 = Math.abs(((ew * Math.sin(t)) * Math.cos(t_1)));
double tmp;
if (ew <= -8.8e+47) {
tmp = t_2;
} else if (ew <= 2.25e-14) {
tmp = Math.abs((eh * (Math.cos(t) * Math.sin(t_1))));
} else if ((ew <= 2.1e+56) || !(ew <= 1.55e+86)) {
tmp = t_2;
} else {
tmp = Math.abs((eh * (Math.cos(t) * Math.sin(Math.atan((((eh / ew) + (-0.3333333333333333 * ((eh * Math.pow(t, 2.0)) / ew))) / t))))));
}
return tmp;
}
def code(eh, ew, t): t_1 = math.atan(((eh / ew) / math.tan(t))) t_2 = math.fabs(((ew * math.sin(t)) * math.cos(t_1))) tmp = 0 if ew <= -8.8e+47: tmp = t_2 elif ew <= 2.25e-14: tmp = math.fabs((eh * (math.cos(t) * math.sin(t_1)))) elif (ew <= 2.1e+56) or not (ew <= 1.55e+86): tmp = t_2 else: tmp = math.fabs((eh * (math.cos(t) * math.sin(math.atan((((eh / ew) + (-0.3333333333333333 * ((eh * math.pow(t, 2.0)) / ew))) / t)))))) return tmp
function code(eh, ew, t) t_1 = atan(Float64(Float64(eh / ew) / tan(t))) t_2 = abs(Float64(Float64(ew * sin(t)) * cos(t_1))) tmp = 0.0 if (ew <= -8.8e+47) tmp = t_2; elseif (ew <= 2.25e-14) tmp = abs(Float64(eh * Float64(cos(t) * sin(t_1)))); elseif ((ew <= 2.1e+56) || !(ew <= 1.55e+86)) tmp = t_2; else tmp = abs(Float64(eh * Float64(cos(t) * sin(atan(Float64(Float64(Float64(eh / ew) + Float64(-0.3333333333333333 * Float64(Float64(eh * (t ^ 2.0)) / ew))) / t)))))); end return tmp end
function tmp_2 = code(eh, ew, t) t_1 = atan(((eh / ew) / tan(t))); t_2 = abs(((ew * sin(t)) * cos(t_1))); tmp = 0.0; if (ew <= -8.8e+47) tmp = t_2; elseif (ew <= 2.25e-14) tmp = abs((eh * (cos(t) * sin(t_1)))); elseif ((ew <= 2.1e+56) || ~((ew <= 1.55e+86))) tmp = t_2; else tmp = abs((eh * (cos(t) * sin(atan((((eh / ew) + (-0.3333333333333333 * ((eh * (t ^ 2.0)) / ew))) / t)))))); end tmp_2 = tmp; end
code[eh_, ew_, t_] := Block[{t$95$1 = N[ArcTan[N[(N[(eh / ew), $MachinePrecision] / N[Tan[t], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Abs[N[(N[(ew * N[Sin[t], $MachinePrecision]), $MachinePrecision] * N[Cos[t$95$1], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[ew, -8.8e+47], t$95$2, If[LessEqual[ew, 2.25e-14], N[Abs[N[(eh * N[(N[Cos[t], $MachinePrecision] * N[Sin[t$95$1], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[Or[LessEqual[ew, 2.1e+56], N[Not[LessEqual[ew, 1.55e+86]], $MachinePrecision]], t$95$2, N[Abs[N[(eh * N[(N[Cos[t], $MachinePrecision] * N[Sin[N[ArcTan[N[(N[(N[(eh / ew), $MachinePrecision] + N[(-0.3333333333333333 * N[(N[(eh * N[Power[t, 2.0], $MachinePrecision]), $MachinePrecision] / ew), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\\
t_2 := \left|\left(ew \cdot \sin t\right) \cdot \cos t\_1\right|\\
\mathbf{if}\;ew \leq -8.8 \cdot 10^{+47}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;ew \leq 2.25 \cdot 10^{-14}:\\
\;\;\;\;\left|eh \cdot \left(\cos t \cdot \sin t\_1\right)\right|\\
\mathbf{elif}\;ew \leq 2.1 \cdot 10^{+56} \lor \neg \left(ew \leq 1.55 \cdot 10^{+86}\right):\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;\left|eh \cdot \left(\cos t \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew} + -0.3333333333333333 \cdot \frac{eh \cdot {t}^{2}}{ew}}{t}\right)\right)\right|\\
\end{array}
\end{array}
if ew < -8.7999999999999997e47 or 2.2499999999999999e-14 < ew < 2.10000000000000017e56 or 1.5500000000000001e86 < ew Initial program 99.8%
associate-*l*99.8%
fma-define99.8%
associate-/r*99.8%
associate-*l*99.8%
associate-/r*99.8%
Simplified99.8%
Taylor expanded in ew around inf 99.8%
+-commutative99.8%
associate-/l*99.7%
fma-define99.7%
associate-/l*99.7%
associate-/r*99.7%
associate-/r*99.7%
Simplified99.7%
Taylor expanded in ew around inf 76.8%
*-commutative76.8%
associate-/r*76.8%
associate-*l*76.8%
Simplified76.8%
if -8.7999999999999997e47 < ew < 2.2499999999999999e-14Initial program 99.8%
associate-*l*99.8%
fma-define99.8%
associate-/r*99.8%
associate-*l*99.8%
associate-/r*99.8%
Simplified99.8%
Taylor expanded in ew around 0 85.3%
associate-/r*85.3%
Simplified85.3%
if 2.10000000000000017e56 < ew < 1.5500000000000001e86Initial program 100.0%
associate-*l*100.0%
fma-define100.0%
associate-/r*100.0%
associate-*l*100.0%
associate-/r*100.0%
Simplified100.0%
Taylor expanded in ew around 0 96.1%
Taylor expanded in t around 0 96.4%
Final simplification82.0%
(FPCore (eh ew t)
:precision binary64
(let* ((t_1 (atan (/ (/ eh ew) (tan t))))
(t_2 (fabs (* (* ew (sin t)) (cos t_1)))))
(if (<= ew -2.85e+46)
t_2
(if (<= ew 2.4e-14)
(fabs (* eh (* (cos t) (sin t_1))))
(if (or (<= ew 8.5e+55) (not (<= ew 2.05e+85)))
t_2
(fabs (* eh (* (cos t) (sin (atan (/ eh (* ew (tan t)))))))))))))
double code(double eh, double ew, double t) {
double t_1 = atan(((eh / ew) / tan(t)));
double t_2 = fabs(((ew * sin(t)) * cos(t_1)));
double tmp;
if (ew <= -2.85e+46) {
tmp = t_2;
} else if (ew <= 2.4e-14) {
tmp = fabs((eh * (cos(t) * sin(t_1))));
} else if ((ew <= 8.5e+55) || !(ew <= 2.05e+85)) {
tmp = t_2;
} else {
tmp = fabs((eh * (cos(t) * sin(atan((eh / (ew * tan(t))))))));
}
return tmp;
}
real(8) function code(eh, ew, t)
real(8), intent (in) :: eh
real(8), intent (in) :: ew
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = atan(((eh / ew) / tan(t)))
t_2 = abs(((ew * sin(t)) * cos(t_1)))
if (ew <= (-2.85d+46)) then
tmp = t_2
else if (ew <= 2.4d-14) then
tmp = abs((eh * (cos(t) * sin(t_1))))
else if ((ew <= 8.5d+55) .or. (.not. (ew <= 2.05d+85))) then
tmp = t_2
else
tmp = abs((eh * (cos(t) * sin(atan((eh / (ew * tan(t))))))))
end if
code = tmp
end function
public static double code(double eh, double ew, double t) {
double t_1 = Math.atan(((eh / ew) / Math.tan(t)));
double t_2 = Math.abs(((ew * Math.sin(t)) * Math.cos(t_1)));
double tmp;
if (ew <= -2.85e+46) {
tmp = t_2;
} else if (ew <= 2.4e-14) {
tmp = Math.abs((eh * (Math.cos(t) * Math.sin(t_1))));
} else if ((ew <= 8.5e+55) || !(ew <= 2.05e+85)) {
tmp = t_2;
} else {
tmp = Math.abs((eh * (Math.cos(t) * Math.sin(Math.atan((eh / (ew * Math.tan(t))))))));
}
return tmp;
}
def code(eh, ew, t): t_1 = math.atan(((eh / ew) / math.tan(t))) t_2 = math.fabs(((ew * math.sin(t)) * math.cos(t_1))) tmp = 0 if ew <= -2.85e+46: tmp = t_2 elif ew <= 2.4e-14: tmp = math.fabs((eh * (math.cos(t) * math.sin(t_1)))) elif (ew <= 8.5e+55) or not (ew <= 2.05e+85): tmp = t_2 else: tmp = math.fabs((eh * (math.cos(t) * math.sin(math.atan((eh / (ew * math.tan(t)))))))) return tmp
function code(eh, ew, t) t_1 = atan(Float64(Float64(eh / ew) / tan(t))) t_2 = abs(Float64(Float64(ew * sin(t)) * cos(t_1))) tmp = 0.0 if (ew <= -2.85e+46) tmp = t_2; elseif (ew <= 2.4e-14) tmp = abs(Float64(eh * Float64(cos(t) * sin(t_1)))); elseif ((ew <= 8.5e+55) || !(ew <= 2.05e+85)) tmp = t_2; else tmp = abs(Float64(eh * Float64(cos(t) * sin(atan(Float64(eh / Float64(ew * tan(t)))))))); end return tmp end
function tmp_2 = code(eh, ew, t) t_1 = atan(((eh / ew) / tan(t))); t_2 = abs(((ew * sin(t)) * cos(t_1))); tmp = 0.0; if (ew <= -2.85e+46) tmp = t_2; elseif (ew <= 2.4e-14) tmp = abs((eh * (cos(t) * sin(t_1)))); elseif ((ew <= 8.5e+55) || ~((ew <= 2.05e+85))) tmp = t_2; else tmp = abs((eh * (cos(t) * sin(atan((eh / (ew * tan(t)))))))); end tmp_2 = tmp; end
code[eh_, ew_, t_] := Block[{t$95$1 = N[ArcTan[N[(N[(eh / ew), $MachinePrecision] / N[Tan[t], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Abs[N[(N[(ew * N[Sin[t], $MachinePrecision]), $MachinePrecision] * N[Cos[t$95$1], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[ew, -2.85e+46], t$95$2, If[LessEqual[ew, 2.4e-14], N[Abs[N[(eh * N[(N[Cos[t], $MachinePrecision] * N[Sin[t$95$1], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[Or[LessEqual[ew, 8.5e+55], N[Not[LessEqual[ew, 2.05e+85]], $MachinePrecision]], t$95$2, N[Abs[N[(eh * N[(N[Cos[t], $MachinePrecision] * N[Sin[N[ArcTan[N[(eh / N[(ew * N[Tan[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\\
t_2 := \left|\left(ew \cdot \sin t\right) \cdot \cos t\_1\right|\\
\mathbf{if}\;ew \leq -2.85 \cdot 10^{+46}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;ew \leq 2.4 \cdot 10^{-14}:\\
\;\;\;\;\left|eh \cdot \left(\cos t \cdot \sin t\_1\right)\right|\\
\mathbf{elif}\;ew \leq 8.5 \cdot 10^{+55} \lor \neg \left(ew \leq 2.05 \cdot 10^{+85}\right):\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;\left|eh \cdot \left(\cos t \cdot \sin \tan^{-1} \left(\frac{eh}{ew \cdot \tan t}\right)\right)\right|\\
\end{array}
\end{array}
if ew < -2.84999999999999994e46 or 2.4e-14 < ew < 8.50000000000000002e55 or 2.04999999999999989e85 < ew Initial program 99.8%
associate-*l*99.8%
fma-define99.8%
associate-/r*99.8%
associate-*l*99.8%
associate-/r*99.8%
Simplified99.8%
Taylor expanded in ew around inf 99.8%
+-commutative99.8%
associate-/l*99.7%
fma-define99.7%
associate-/l*99.7%
associate-/r*99.7%
associate-/r*99.7%
Simplified99.7%
Taylor expanded in ew around inf 76.8%
*-commutative76.8%
associate-/r*76.8%
associate-*l*76.8%
Simplified76.8%
if -2.84999999999999994e46 < ew < 2.4e-14Initial program 99.8%
associate-*l*99.8%
fma-define99.8%
associate-/r*99.8%
associate-*l*99.8%
associate-/r*99.8%
Simplified99.8%
Taylor expanded in ew around 0 85.3%
associate-/r*85.3%
Simplified85.3%
if 8.50000000000000002e55 < ew < 2.04999999999999989e85Initial program 100.0%
associate-*l*100.0%
fma-define100.0%
associate-/r*100.0%
associate-*l*100.0%
associate-/r*100.0%
Simplified100.0%
Taylor expanded in ew around 0 96.1%
Final simplification82.0%
(FPCore (eh ew t)
:precision binary64
(let* ((t_1 (sin (atan (/ eh (* ew (tan t)))))))
(if (or (<= t -0.0085) (not (<= t 3e-19)))
(fabs (* eh (* (cos t) t_1)))
(fabs (+ (* eh t_1) (* ew t))))))
double code(double eh, double ew, double t) {
double t_1 = sin(atan((eh / (ew * tan(t)))));
double tmp;
if ((t <= -0.0085) || !(t <= 3e-19)) {
tmp = fabs((eh * (cos(t) * t_1)));
} else {
tmp = fabs(((eh * 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 ((t <= (-0.0085d0)) .or. (.not. (t <= 3d-19))) then
tmp = abs((eh * (cos(t) * t_1)))
else
tmp = abs(((eh * 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 ((t <= -0.0085) || !(t <= 3e-19)) {
tmp = Math.abs((eh * (Math.cos(t) * t_1)));
} else {
tmp = Math.abs(((eh * 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 (t <= -0.0085) or not (t <= 3e-19): tmp = math.fabs((eh * (math.cos(t) * t_1))) else: tmp = math.fabs(((eh * t_1) + (ew * t))) return tmp
function code(eh, ew, t) t_1 = sin(atan(Float64(eh / Float64(ew * tan(t))))) tmp = 0.0 if ((t <= -0.0085) || !(t <= 3e-19)) tmp = abs(Float64(eh * Float64(cos(t) * t_1))); else tmp = abs(Float64(Float64(eh * 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 ((t <= -0.0085) || ~((t <= 3e-19))) tmp = abs((eh * (cos(t) * t_1))); else tmp = abs(((eh * t_1) + (ew * t))); end tmp_2 = tmp; end
code[eh_, ew_, t_] := Block[{t$95$1 = N[Sin[N[ArcTan[N[(eh / N[(ew * N[Tan[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]}, If[Or[LessEqual[t, -0.0085], N[Not[LessEqual[t, 3e-19]], $MachinePrecision]], N[Abs[N[(eh * N[(N[Cos[t], $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Abs[N[(N[(eh * t$95$1), $MachinePrecision] + N[(ew * t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \sin \tan^{-1} \left(\frac{eh}{ew \cdot \tan t}\right)\\
\mathbf{if}\;t \leq -0.0085 \lor \neg \left(t \leq 3 \cdot 10^{-19}\right):\\
\;\;\;\;\left|eh \cdot \left(\cos t \cdot t\_1\right)\right|\\
\mathbf{else}:\\
\;\;\;\;\left|eh \cdot t\_1 + ew \cdot t\right|\\
\end{array}
\end{array}
if t < -0.0085000000000000006 or 2.99999999999999993e-19 < t Initial program 99.6%
associate-*l*99.6%
fma-define99.6%
associate-/r*99.6%
associate-*l*99.6%
associate-/r*99.6%
Simplified99.6%
Taylor expanded in ew around 0 54.7%
if -0.0085000000000000006 < t < 2.99999999999999993e-19Initial program 100.0%
associate-*l*100.0%
fma-define100.0%
associate-/r*100.0%
associate-*l*100.0%
associate-/r*100.0%
Simplified100.0%
log1p-expm1-u100.0%
cos-atan100.0%
un-div-inv100.0%
hypot-1-def100.0%
Applied egg-rr100.0%
Taylor expanded in eh around 0 98.6%
Taylor expanded in t around 0 98.2%
Final simplification74.3%
(FPCore (eh ew t)
:precision binary64
(if (<= t -1.65e+171)
(* eh (* (cos t) (sin (atan (/ (/ eh ew) (tan t))))))
(if (or (<= t -0.0021) (not (<= t 3e-19)))
(fabs (* eh (* (cos t) (sin (atan (/ eh (* ew t)))))))
(fabs (+ (* eh (sin (atan (/ eh (* ew (tan t)))))) (* ew t))))))
double code(double eh, double ew, double t) {
double tmp;
if (t <= -1.65e+171) {
tmp = eh * (cos(t) * sin(atan(((eh / ew) / tan(t)))));
} else if ((t <= -0.0021) || !(t <= 3e-19)) {
tmp = fabs((eh * (cos(t) * sin(atan((eh / (ew * t)))))));
} else {
tmp = fabs(((eh * sin(atan((eh / (ew * tan(t)))))) + (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) :: tmp
if (t <= (-1.65d+171)) then
tmp = eh * (cos(t) * sin(atan(((eh / ew) / tan(t)))))
else if ((t <= (-0.0021d0)) .or. (.not. (t <= 3d-19))) then
tmp = abs((eh * (cos(t) * sin(atan((eh / (ew * t)))))))
else
tmp = abs(((eh * sin(atan((eh / (ew * tan(t)))))) + (ew * t)))
end if
code = tmp
end function
public static double code(double eh, double ew, double t) {
double tmp;
if (t <= -1.65e+171) {
tmp = eh * (Math.cos(t) * Math.sin(Math.atan(((eh / ew) / Math.tan(t)))));
} else if ((t <= -0.0021) || !(t <= 3e-19)) {
tmp = Math.abs((eh * (Math.cos(t) * Math.sin(Math.atan((eh / (ew * t)))))));
} else {
tmp = Math.abs(((eh * Math.sin(Math.atan((eh / (ew * Math.tan(t)))))) + (ew * t)));
}
return tmp;
}
def code(eh, ew, t): tmp = 0 if t <= -1.65e+171: tmp = eh * (math.cos(t) * math.sin(math.atan(((eh / ew) / math.tan(t))))) elif (t <= -0.0021) or not (t <= 3e-19): tmp = math.fabs((eh * (math.cos(t) * math.sin(math.atan((eh / (ew * t))))))) else: tmp = math.fabs(((eh * math.sin(math.atan((eh / (ew * math.tan(t)))))) + (ew * t))) return tmp
function code(eh, ew, t) tmp = 0.0 if (t <= -1.65e+171) tmp = Float64(eh * Float64(cos(t) * sin(atan(Float64(Float64(eh / ew) / tan(t)))))); elseif ((t <= -0.0021) || !(t <= 3e-19)) tmp = abs(Float64(eh * Float64(cos(t) * sin(atan(Float64(eh / Float64(ew * t))))))); else tmp = abs(Float64(Float64(eh * sin(atan(Float64(eh / Float64(ew * tan(t)))))) + Float64(ew * t))); end return tmp end
function tmp_2 = code(eh, ew, t) tmp = 0.0; if (t <= -1.65e+171) tmp = eh * (cos(t) * sin(atan(((eh / ew) / tan(t))))); elseif ((t <= -0.0021) || ~((t <= 3e-19))) tmp = abs((eh * (cos(t) * sin(atan((eh / (ew * t))))))); else tmp = abs(((eh * sin(atan((eh / (ew * tan(t)))))) + (ew * t))); end tmp_2 = tmp; end
code[eh_, ew_, t_] := If[LessEqual[t, -1.65e+171], N[(eh * N[(N[Cos[t], $MachinePrecision] * N[Sin[N[ArcTan[N[(N[(eh / ew), $MachinePrecision] / N[Tan[t], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[t, -0.0021], N[Not[LessEqual[t, 3e-19]], $MachinePrecision]], N[Abs[N[(eh * N[(N[Cos[t], $MachinePrecision] * N[Sin[N[ArcTan[N[(eh / N[(ew * t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Abs[N[(N[(eh * N[Sin[N[ArcTan[N[(eh / N[(ew * N[Tan[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + N[(ew * t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.65 \cdot 10^{+171}:\\
\;\;\;\;eh \cdot \left(\cos t \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right)\\
\mathbf{elif}\;t \leq -0.0021 \lor \neg \left(t \leq 3 \cdot 10^{-19}\right):\\
\;\;\;\;\left|eh \cdot \left(\cos t \cdot \sin \tan^{-1} \left(\frac{eh}{ew \cdot t}\right)\right)\right|\\
\mathbf{else}:\\
\;\;\;\;\left|eh \cdot \sin \tan^{-1} \left(\frac{eh}{ew \cdot \tan t}\right) + ew \cdot t\right|\\
\end{array}
\end{array}
if t < -1.64999999999999996e171Initial program 99.7%
associate-*l*99.7%
fma-define99.7%
associate-/r*99.7%
associate-*l*99.7%
associate-/r*99.7%
Simplified99.7%
Taylor expanded in ew around 0 54.3%
add-sqr-sqrt36.6%
fabs-sqr36.6%
add-sqr-sqrt37.2%
*-commutative37.2%
associate-/r*37.2%
Applied egg-rr37.2%
if -1.64999999999999996e171 < t < -0.00209999999999999987 or 2.99999999999999993e-19 < t Initial program 99.6%
associate-*l*99.6%
fma-define99.6%
associate-/r*99.6%
associate-*l*99.6%
associate-/r*99.6%
Simplified99.6%
Taylor expanded in ew around 0 54.8%
Taylor expanded in t around 0 44.4%
*-commutative44.4%
Simplified44.4%
if -0.00209999999999999987 < t < 2.99999999999999993e-19Initial program 100.0%
associate-*l*100.0%
fma-define100.0%
associate-/r*100.0%
associate-*l*100.0%
associate-/r*100.0%
Simplified100.0%
log1p-expm1-u100.0%
cos-atan100.0%
un-div-inv100.0%
hypot-1-def100.0%
Applied egg-rr100.0%
Taylor expanded in eh around 0 98.6%
Taylor expanded in t around 0 98.2%
Final simplification67.8%
(FPCore (eh ew t) :precision binary64 (if (or (<= eh -2.9e-126) (not (<= eh 3.8e-142))) (fabs (* eh (* (cos t) (sin (atan (/ eh (* ew t))))))) (+ (* ew t) (* eh (sin (atan (/ (/ eh ew) (tan t))))))))
double code(double eh, double ew, double t) {
double tmp;
if ((eh <= -2.9e-126) || !(eh <= 3.8e-142)) {
tmp = fabs((eh * (cos(t) * sin(atan((eh / (ew * t)))))));
} else {
tmp = (ew * t) + (eh * sin(atan(((eh / ew) / tan(t)))));
}
return tmp;
}
real(8) function code(eh, ew, t)
real(8), intent (in) :: eh
real(8), intent (in) :: ew
real(8), intent (in) :: t
real(8) :: tmp
if ((eh <= (-2.9d-126)) .or. (.not. (eh <= 3.8d-142))) then
tmp = abs((eh * (cos(t) * sin(atan((eh / (ew * t)))))))
else
tmp = (ew * t) + (eh * sin(atan(((eh / ew) / tan(t)))))
end if
code = tmp
end function
public static double code(double eh, double ew, double t) {
double tmp;
if ((eh <= -2.9e-126) || !(eh <= 3.8e-142)) {
tmp = Math.abs((eh * (Math.cos(t) * Math.sin(Math.atan((eh / (ew * t)))))));
} else {
tmp = (ew * t) + (eh * Math.sin(Math.atan(((eh / ew) / Math.tan(t)))));
}
return tmp;
}
def code(eh, ew, t): tmp = 0 if (eh <= -2.9e-126) or not (eh <= 3.8e-142): tmp = math.fabs((eh * (math.cos(t) * math.sin(math.atan((eh / (ew * t))))))) else: tmp = (ew * t) + (eh * math.sin(math.atan(((eh / ew) / math.tan(t))))) return tmp
function code(eh, ew, t) tmp = 0.0 if ((eh <= -2.9e-126) || !(eh <= 3.8e-142)) tmp = abs(Float64(eh * Float64(cos(t) * sin(atan(Float64(eh / Float64(ew * t))))))); else tmp = Float64(Float64(ew * t) + Float64(eh * sin(atan(Float64(Float64(eh / ew) / tan(t)))))); end return tmp end
function tmp_2 = code(eh, ew, t) tmp = 0.0; if ((eh <= -2.9e-126) || ~((eh <= 3.8e-142))) tmp = abs((eh * (cos(t) * sin(atan((eh / (ew * t))))))); else tmp = (ew * t) + (eh * sin(atan(((eh / ew) / tan(t))))); end tmp_2 = tmp; end
code[eh_, ew_, t_] := If[Or[LessEqual[eh, -2.9e-126], N[Not[LessEqual[eh, 3.8e-142]], $MachinePrecision]], N[Abs[N[(eh * N[(N[Cos[t], $MachinePrecision] * N[Sin[N[ArcTan[N[(eh / N[(ew * t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(N[(ew * t), $MachinePrecision] + N[(eh * N[Sin[N[ArcTan[N[(N[(eh / ew), $MachinePrecision] / N[Tan[t], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;eh \leq -2.9 \cdot 10^{-126} \lor \neg \left(eh \leq 3.8 \cdot 10^{-142}\right):\\
\;\;\;\;\left|eh \cdot \left(\cos t \cdot \sin \tan^{-1} \left(\frac{eh}{ew \cdot t}\right)\right)\right|\\
\mathbf{else}:\\
\;\;\;\;ew \cdot t + eh \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\\
\end{array}
\end{array}
if eh < -2.89999999999999988e-126 or 3.79999999999999972e-142 < eh Initial program 99.8%
associate-*l*99.8%
fma-define99.8%
associate-/r*99.8%
associate-*l*99.8%
associate-/r*99.8%
Simplified99.8%
Taylor expanded in ew around 0 74.8%
Taylor expanded in t around 0 65.3%
*-commutative65.3%
Simplified65.3%
if -2.89999999999999988e-126 < eh < 3.79999999999999972e-142Initial program 99.8%
associate-*l*99.8%
fma-define99.8%
associate-/r*99.8%
associate-*l*99.8%
associate-/r*99.8%
Simplified99.8%
Taylor expanded in t around 0 55.2%
fma-define55.2%
associate-/r*55.2%
associate-*r*55.2%
associate-/r*55.2%
Simplified55.2%
add-sqr-sqrt32.2%
fabs-sqr32.2%
add-sqr-sqrt33.2%
fma-undefine33.2%
associate-/r*33.2%
cos-atan33.2%
hypot-1-def33.2%
un-div-inv33.2%
Applied egg-rr33.2%
Taylor expanded in ew around inf 32.3%
*-commutative32.3%
Simplified32.3%
Final simplification55.9%
(FPCore (eh ew t) :precision binary64 (if (or (<= eh -3.4e-128) (not (<= eh 2e-109))) (fabs (* eh (sin (atan (/ eh (* ew (tan t))))))) (+ (* ew t) (* eh (sin (atan (/ (/ eh ew) (tan t))))))))
double code(double eh, double ew, double t) {
double tmp;
if ((eh <= -3.4e-128) || !(eh <= 2e-109)) {
tmp = fabs((eh * sin(atan((eh / (ew * tan(t)))))));
} else {
tmp = (ew * t) + (eh * sin(atan(((eh / ew) / tan(t)))));
}
return tmp;
}
real(8) function code(eh, ew, t)
real(8), intent (in) :: eh
real(8), intent (in) :: ew
real(8), intent (in) :: t
real(8) :: tmp
if ((eh <= (-3.4d-128)) .or. (.not. (eh <= 2d-109))) then
tmp = abs((eh * sin(atan((eh / (ew * tan(t)))))))
else
tmp = (ew * t) + (eh * sin(atan(((eh / ew) / tan(t)))))
end if
code = tmp
end function
public static double code(double eh, double ew, double t) {
double tmp;
if ((eh <= -3.4e-128) || !(eh <= 2e-109)) {
tmp = Math.abs((eh * Math.sin(Math.atan((eh / (ew * Math.tan(t)))))));
} else {
tmp = (ew * t) + (eh * Math.sin(Math.atan(((eh / ew) / Math.tan(t)))));
}
return tmp;
}
def code(eh, ew, t): tmp = 0 if (eh <= -3.4e-128) or not (eh <= 2e-109): tmp = math.fabs((eh * math.sin(math.atan((eh / (ew * math.tan(t))))))) else: tmp = (ew * t) + (eh * math.sin(math.atan(((eh / ew) / math.tan(t))))) return tmp
function code(eh, ew, t) tmp = 0.0 if ((eh <= -3.4e-128) || !(eh <= 2e-109)) tmp = abs(Float64(eh * sin(atan(Float64(eh / Float64(ew * tan(t))))))); else tmp = Float64(Float64(ew * t) + Float64(eh * sin(atan(Float64(Float64(eh / ew) / tan(t)))))); end return tmp end
function tmp_2 = code(eh, ew, t) tmp = 0.0; if ((eh <= -3.4e-128) || ~((eh <= 2e-109))) tmp = abs((eh * sin(atan((eh / (ew * tan(t))))))); else tmp = (ew * t) + (eh * sin(atan(((eh / ew) / tan(t))))); end tmp_2 = tmp; end
code[eh_, ew_, t_] := If[Or[LessEqual[eh, -3.4e-128], N[Not[LessEqual[eh, 2e-109]], $MachinePrecision]], N[Abs[N[(eh * N[Sin[N[ArcTan[N[(eh / N[(ew * N[Tan[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(N[(ew * t), $MachinePrecision] + N[(eh * N[Sin[N[ArcTan[N[(N[(eh / ew), $MachinePrecision] / N[Tan[t], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;eh \leq -3.4 \cdot 10^{-128} \lor \neg \left(eh \leq 2 \cdot 10^{-109}\right):\\
\;\;\;\;\left|eh \cdot \sin \tan^{-1} \left(\frac{eh}{ew \cdot \tan t}\right)\right|\\
\mathbf{else}:\\
\;\;\;\;ew \cdot t + eh \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\\
\end{array}
\end{array}
if eh < -3.39999999999999975e-128 or 2e-109 < eh Initial program 99.8%
associate-*l*99.8%
fma-define99.8%
associate-/r*99.8%
associate-*l*99.8%
associate-/r*99.8%
Simplified99.8%
Taylor expanded in ew around 0 76.0%
Taylor expanded in t around 0 48.5%
if -3.39999999999999975e-128 < eh < 2e-109Initial program 99.8%
associate-*l*99.8%
fma-define99.8%
associate-/r*99.8%
associate-*l*99.8%
associate-/r*99.8%
Simplified99.8%
Taylor expanded in t around 0 55.7%
fma-define55.7%
associate-/r*55.7%
associate-*r*55.7%
associate-/r*55.7%
Simplified55.7%
add-sqr-sqrt33.1%
fabs-sqr33.1%
add-sqr-sqrt34.1%
fma-undefine34.1%
associate-/r*34.1%
cos-atan34.2%
hypot-1-def34.2%
un-div-inv34.2%
Applied egg-rr34.2%
Taylor expanded in ew around inf 33.3%
*-commutative33.3%
Simplified33.3%
Final simplification43.8%
(FPCore (eh ew t)
:precision binary64
(if (<= eh -4.6e-128)
(fabs (* eh (sin (atan (* (/ eh ew) (/ 1.0 t))))))
(if (<= eh 8.2e-108)
(+ (* ew t) (* eh (sin (atan (/ (/ eh ew) (tan t))))))
(fabs (* eh (sin (atan (* (/ 1.0 ew) (/ eh t)))))))))
double code(double eh, double ew, double t) {
double tmp;
if (eh <= -4.6e-128) {
tmp = fabs((eh * sin(atan(((eh / ew) * (1.0 / t))))));
} else if (eh <= 8.2e-108) {
tmp = (ew * t) + (eh * sin(atan(((eh / ew) / tan(t)))));
} else {
tmp = fabs((eh * sin(atan(((1.0 / ew) * (eh / 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 (eh <= (-4.6d-128)) then
tmp = abs((eh * sin(atan(((eh / ew) * (1.0d0 / t))))))
else if (eh <= 8.2d-108) then
tmp = (ew * t) + (eh * sin(atan(((eh / ew) / tan(t)))))
else
tmp = abs((eh * sin(atan(((1.0d0 / ew) * (eh / t))))))
end if
code = tmp
end function
public static double code(double eh, double ew, double t) {
double tmp;
if (eh <= -4.6e-128) {
tmp = Math.abs((eh * Math.sin(Math.atan(((eh / ew) * (1.0 / t))))));
} else if (eh <= 8.2e-108) {
tmp = (ew * t) + (eh * Math.sin(Math.atan(((eh / ew) / Math.tan(t)))));
} else {
tmp = Math.abs((eh * Math.sin(Math.atan(((1.0 / ew) * (eh / t))))));
}
return tmp;
}
def code(eh, ew, t): tmp = 0 if eh <= -4.6e-128: tmp = math.fabs((eh * math.sin(math.atan(((eh / ew) * (1.0 / t)))))) elif eh <= 8.2e-108: tmp = (ew * t) + (eh * math.sin(math.atan(((eh / ew) / math.tan(t))))) else: tmp = math.fabs((eh * math.sin(math.atan(((1.0 / ew) * (eh / t)))))) return tmp
function code(eh, ew, t) tmp = 0.0 if (eh <= -4.6e-128) tmp = abs(Float64(eh * sin(atan(Float64(Float64(eh / ew) * Float64(1.0 / t)))))); elseif (eh <= 8.2e-108) tmp = Float64(Float64(ew * t) + Float64(eh * sin(atan(Float64(Float64(eh / ew) / tan(t)))))); else tmp = abs(Float64(eh * sin(atan(Float64(Float64(1.0 / ew) * Float64(eh / t)))))); end return tmp end
function tmp_2 = code(eh, ew, t) tmp = 0.0; if (eh <= -4.6e-128) tmp = abs((eh * sin(atan(((eh / ew) * (1.0 / t)))))); elseif (eh <= 8.2e-108) tmp = (ew * t) + (eh * sin(atan(((eh / ew) / tan(t))))); else tmp = abs((eh * sin(atan(((1.0 / ew) * (eh / t)))))); end tmp_2 = tmp; end
code[eh_, ew_, t_] := If[LessEqual[eh, -4.6e-128], N[Abs[N[(eh * N[Sin[N[ArcTan[N[(N[(eh / ew), $MachinePrecision] * N[(1.0 / t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[eh, 8.2e-108], N[(N[(ew * t), $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[(N[(1.0 / ew), $MachinePrecision] * N[(eh / t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;eh \leq -4.6 \cdot 10^{-128}:\\
\;\;\;\;\left|eh \cdot \sin \tan^{-1} \left(\frac{eh}{ew} \cdot \frac{1}{t}\right)\right|\\
\mathbf{elif}\;eh \leq 8.2 \cdot 10^{-108}:\\
\;\;\;\;ew \cdot t + eh \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\\
\mathbf{else}:\\
\;\;\;\;\left|eh \cdot \sin \tan^{-1} \left(\frac{1}{ew} \cdot \frac{eh}{t}\right)\right|\\
\end{array}
\end{array}
if eh < -4.6000000000000002e-128Initial program 99.8%
associate-*l*99.8%
fma-define99.8%
associate-/r*99.8%
associate-*l*99.8%
associate-/r*99.8%
Simplified99.8%
Taylor expanded in ew around 0 79.5%
Taylor expanded in t around 0 47.1%
Taylor expanded in t around 0 44.5%
*-commutative67.9%
Simplified44.5%
associate-/l/44.6%
div-inv44.6%
Applied egg-rr44.6%
if -4.6000000000000002e-128 < eh < 8.20000000000000074e-108Initial program 99.8%
associate-*l*99.8%
fma-define99.8%
associate-/r*99.8%
associate-*l*99.8%
associate-/r*99.8%
Simplified99.8%
Taylor expanded in t around 0 55.7%
fma-define55.7%
associate-/r*55.7%
associate-*r*55.7%
associate-/r*55.7%
Simplified55.7%
add-sqr-sqrt33.1%
fabs-sqr33.1%
add-sqr-sqrt34.1%
fma-undefine34.1%
associate-/r*34.1%
cos-atan34.2%
hypot-1-def34.2%
un-div-inv34.2%
Applied egg-rr34.2%
Taylor expanded in ew around inf 33.3%
*-commutative33.3%
Simplified33.3%
if 8.20000000000000074e-108 < eh Initial program 99.7%
associate-*l*99.7%
fma-define99.8%
associate-/r*99.8%
associate-*l*99.8%
associate-/r*99.8%
Simplified99.8%
Taylor expanded in ew around 0 72.1%
Taylor expanded in t around 0 50.1%
Taylor expanded in t around 0 48.6%
*-commutative64.1%
Simplified48.6%
*-un-lft-identity48.6%
*-commutative48.6%
times-frac48.8%
Applied egg-rr48.8%
Final simplification42.4%
(FPCore (eh ew t) :precision binary64 (fabs (* eh (sin (atan (* (/ eh ew) (/ 1.0 t)))))))
double code(double eh, double ew, double t) {
return fabs((eh * sin(atan(((eh / ew) * (1.0 / 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) * (1.0d0 / t))))))
end function
public static double code(double eh, double ew, double t) {
return Math.abs((eh * Math.sin(Math.atan(((eh / ew) * (1.0 / t))))));
}
def code(eh, ew, t): return math.fabs((eh * math.sin(math.atan(((eh / ew) * (1.0 / t))))))
function code(eh, ew, t) return abs(Float64(eh * sin(atan(Float64(Float64(eh / ew) * Float64(1.0 / t)))))) end
function tmp = code(eh, ew, t) tmp = abs((eh * sin(atan(((eh / ew) * (1.0 / t)))))); end
code[eh_, ew_, t_] := N[Abs[N[(eh * N[Sin[N[ArcTan[N[(N[(eh / ew), $MachinePrecision] * N[(1.0 / t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\left|eh \cdot \sin \tan^{-1} \left(\frac{eh}{ew} \cdot \frac{1}{t}\right)\right|
\end{array}
Initial program 99.8%
associate-*l*99.8%
fma-define99.8%
associate-/r*99.8%
associate-*l*99.8%
associate-/r*99.8%
Simplified99.8%
Taylor expanded in ew around 0 61.0%
Taylor expanded in t around 0 40.1%
Taylor expanded in t around 0 38.3%
*-commutative52.4%
Simplified38.3%
associate-/l/38.4%
div-inv38.4%
Applied egg-rr38.4%
(FPCore (eh ew t) :precision binary64 (fabs (* eh (sin (atan (* (/ 1.0 ew) (/ eh t)))))))
double code(double eh, double ew, double t) {
return fabs((eh * sin(atan(((1.0 / ew) * (eh / 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(((1.0d0 / ew) * (eh / t))))))
end function
public static double code(double eh, double ew, double t) {
return Math.abs((eh * Math.sin(Math.atan(((1.0 / ew) * (eh / t))))));
}
def code(eh, ew, t): return math.fabs((eh * math.sin(math.atan(((1.0 / ew) * (eh / t))))))
function code(eh, ew, t) return abs(Float64(eh * sin(atan(Float64(Float64(1.0 / ew) * Float64(eh / t)))))) end
function tmp = code(eh, ew, t) tmp = abs((eh * sin(atan(((1.0 / ew) * (eh / t)))))); end
code[eh_, ew_, t_] := N[Abs[N[(eh * N[Sin[N[ArcTan[N[(N[(1.0 / ew), $MachinePrecision] * N[(eh / t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\left|eh \cdot \sin \tan^{-1} \left(\frac{1}{ew} \cdot \frac{eh}{t}\right)\right|
\end{array}
Initial program 99.8%
associate-*l*99.8%
fma-define99.8%
associate-/r*99.8%
associate-*l*99.8%
associate-/r*99.8%
Simplified99.8%
Taylor expanded in ew around 0 61.0%
Taylor expanded in t around 0 40.1%
Taylor expanded in t around 0 38.3%
*-commutative52.4%
Simplified38.3%
*-un-lft-identity38.3%
*-commutative38.3%
times-frac38.4%
Applied egg-rr38.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(eh / Float64(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[(eh / N[(ew * t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\left|eh \cdot \sin \tan^{-1} \left(\frac{eh}{ew \cdot t}\right)\right|
\end{array}
Initial program 99.8%
associate-*l*99.8%
fma-define99.8%
associate-/r*99.8%
associate-*l*99.8%
associate-/r*99.8%
Simplified99.8%
Taylor expanded in ew around 0 61.0%
Taylor expanded in t around 0 40.1%
Taylor expanded in t around 0 38.3%
*-commutative52.4%
Simplified38.3%
Final simplification38.3%
(FPCore (eh ew t) :precision binary64 (if (or (<= t -3.5e-196) (not (<= t 3.8e-72))) (fabs (* eh (/ (/ eh t) (* ew (hypot 1.0 (/ eh (* ew t))))))) (* eh (sin (atan (/ (/ eh t) ew))))))
double code(double eh, double ew, double t) {
double tmp;
if ((t <= -3.5e-196) || !(t <= 3.8e-72)) {
tmp = fabs((eh * ((eh / t) / (ew * hypot(1.0, (eh / (ew * t)))))));
} else {
tmp = eh * sin(atan(((eh / t) / ew)));
}
return tmp;
}
public static double code(double eh, double ew, double t) {
double tmp;
if ((t <= -3.5e-196) || !(t <= 3.8e-72)) {
tmp = Math.abs((eh * ((eh / t) / (ew * Math.hypot(1.0, (eh / (ew * t)))))));
} else {
tmp = eh * Math.sin(Math.atan(((eh / t) / ew)));
}
return tmp;
}
def code(eh, ew, t): tmp = 0 if (t <= -3.5e-196) or not (t <= 3.8e-72): tmp = math.fabs((eh * ((eh / t) / (ew * math.hypot(1.0, (eh / (ew * t))))))) else: tmp = eh * math.sin(math.atan(((eh / t) / ew))) return tmp
function code(eh, ew, t) tmp = 0.0 if ((t <= -3.5e-196) || !(t <= 3.8e-72)) tmp = abs(Float64(eh * Float64(Float64(eh / t) / Float64(ew * hypot(1.0, Float64(eh / Float64(ew * t))))))); else tmp = Float64(eh * sin(atan(Float64(Float64(eh / t) / ew)))); end return tmp end
function tmp_2 = code(eh, ew, t) tmp = 0.0; if ((t <= -3.5e-196) || ~((t <= 3.8e-72))) tmp = abs((eh * ((eh / t) / (ew * hypot(1.0, (eh / (ew * t))))))); else tmp = eh * sin(atan(((eh / t) / ew))); end tmp_2 = tmp; end
code[eh_, ew_, t_] := If[Or[LessEqual[t, -3.5e-196], N[Not[LessEqual[t, 3.8e-72]], $MachinePrecision]], N[Abs[N[(eh * N[(N[(eh / t), $MachinePrecision] / N[(ew * N[Sqrt[1.0 ^ 2 + N[(eh / N[(ew * t), $MachinePrecision]), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(eh * N[Sin[N[ArcTan[N[(N[(eh / t), $MachinePrecision] / ew), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -3.5 \cdot 10^{-196} \lor \neg \left(t \leq 3.8 \cdot 10^{-72}\right):\\
\;\;\;\;\left|eh \cdot \frac{\frac{eh}{t}}{ew \cdot \mathsf{hypot}\left(1, \frac{eh}{ew \cdot t}\right)}\right|\\
\mathbf{else}:\\
\;\;\;\;eh \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{t}}{ew}\right)\\
\end{array}
\end{array}
if t < -3.50000000000000004e-196 or 3.80000000000000002e-72 < t Initial program 99.7%
associate-*l*99.7%
fma-define99.7%
associate-/r*99.7%
associate-*l*99.7%
associate-/r*99.7%
Simplified99.7%
Taylor expanded in ew around 0 56.2%
Taylor expanded in t around 0 27.4%
Taylor expanded in t around 0 25.0%
*-commutative44.3%
Simplified25.0%
sin-atan11.6%
associate-/r*11.7%
hypot-1-def18.6%
associate-/r*20.9%
Applied egg-rr20.9%
associate-/l/21.0%
associate-/l/18.7%
Simplified18.7%
if -3.50000000000000004e-196 < t < 3.80000000000000002e-72Initial program 100.0%
associate-*l*100.0%
fma-define100.0%
associate-/r*100.0%
associate-*l*100.0%
associate-/r*100.0%
Simplified100.0%
Taylor expanded in ew around 0 74.2%
Taylor expanded in t around 0 74.2%
Taylor expanded in t around 0 74.2%
*-commutative74.2%
Simplified74.2%
add-sqr-sqrt37.5%
fabs-sqr37.5%
add-sqr-sqrt38.3%
*-commutative38.3%
associate-/r*38.3%
Applied egg-rr38.3%
Final simplification24.0%
(FPCore (eh ew t)
:precision binary64
(let* ((t_1 (/ (/ eh t) ew)))
(if (<= eh 3.2e+70)
(fabs (* eh (/ t_1 (hypot 1.0 t_1))))
(* eh (sin (atan t_1))))))
double code(double eh, double ew, double t) {
double t_1 = (eh / t) / ew;
double tmp;
if (eh <= 3.2e+70) {
tmp = fabs((eh * (t_1 / 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 / t) / ew;
double tmp;
if (eh <= 3.2e+70) {
tmp = Math.abs((eh * (t_1 / 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 / t) / ew tmp = 0 if eh <= 3.2e+70: tmp = math.fabs((eh * (t_1 / 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(Float64(eh / t) / ew) tmp = 0.0 if (eh <= 3.2e+70) tmp = abs(Float64(eh * Float64(t_1 / 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 / t) / ew; tmp = 0.0; if (eh <= 3.2e+70) tmp = abs((eh * (t_1 / 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[(N[(eh / t), $MachinePrecision] / ew), $MachinePrecision]}, If[LessEqual[eh, 3.2e+70], N[Abs[N[(eh * N[(t$95$1 / N[Sqrt[1.0 ^ 2 + t$95$1 ^ 2], $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{\frac{eh}{t}}{ew}\\
\mathbf{if}\;eh \leq 3.2 \cdot 10^{+70}:\\
\;\;\;\;\left|eh \cdot \frac{t\_1}{\mathsf{hypot}\left(1, t\_1\right)}\right|\\
\mathbf{else}:\\
\;\;\;\;eh \cdot \sin \tan^{-1} t\_1\\
\end{array}
\end{array}
if eh < 3.2000000000000002e70Initial program 99.8%
associate-*l*99.8%
fma-define99.8%
associate-/r*99.8%
associate-*l*99.8%
associate-/r*99.8%
Simplified99.8%
Taylor expanded in ew around 0 55.0%
Taylor expanded in t around 0 35.7%
Taylor expanded in t around 0 34.0%
*-commutative46.6%
Simplified34.0%
sin-atan11.9%
associate-/r*11.7%
hypot-1-def19.2%
associate-/r*23.1%
Applied egg-rr23.1%
if 3.2000000000000002e70 < eh Initial program 99.8%
associate-*l*99.8%
fma-define99.8%
associate-/r*99.8%
associate-*l*99.8%
associate-/r*99.8%
Simplified99.8%
Taylor expanded in ew around 0 89.1%
Taylor expanded in t around 0 60.3%
Taylor expanded in t around 0 58.4%
*-commutative79.5%
Simplified58.4%
add-sqr-sqrt29.9%
fabs-sqr29.9%
add-sqr-sqrt30.3%
*-commutative30.3%
associate-/r*30.4%
Applied egg-rr30.4%
Final simplification24.4%
(FPCore (eh ew t) :precision binary64 (* eh (sin (atan (/ (/ eh t) ew)))))
double code(double eh, double ew, double t) {
return eh * sin(atan(((eh / t) / ew)));
}
real(8) function code(eh, ew, t)
real(8), intent (in) :: eh
real(8), intent (in) :: ew
real(8), intent (in) :: t
code = eh * sin(atan(((eh / t) / ew)))
end function
public static double code(double eh, double ew, double t) {
return eh * Math.sin(Math.atan(((eh / t) / ew)));
}
def code(eh, ew, t): return eh * math.sin(math.atan(((eh / t) / ew)))
function code(eh, ew, t) return Float64(eh * sin(atan(Float64(Float64(eh / t) / ew)))) end
function tmp = code(eh, ew, t) tmp = eh * sin(atan(((eh / t) / ew))); end
code[eh_, ew_, t_] := N[(eh * N[Sin[N[ArcTan[N[(N[(eh / t), $MachinePrecision] / ew), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
eh \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{t}}{ew}\right)
\end{array}
Initial program 99.8%
associate-*l*99.8%
fma-define99.8%
associate-/r*99.8%
associate-*l*99.8%
associate-/r*99.8%
Simplified99.8%
Taylor expanded in ew around 0 61.0%
Taylor expanded in t around 0 40.1%
Taylor expanded in t around 0 38.3%
*-commutative52.4%
Simplified38.3%
add-sqr-sqrt17.5%
fabs-sqr17.5%
add-sqr-sqrt18.2%
*-commutative18.2%
associate-/r*18.2%
Applied egg-rr18.2%
Final simplification18.2%
herbie shell --seed 2024110
(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))))))))