
(FPCore (eh ew t) :precision binary64 (let* ((t_1 (atan (/ (* (- eh) (tan t)) ew)))) (fabs (- (* (* ew (cos t)) (cos t_1)) (* (* eh (sin t)) (sin t_1))))))
double code(double eh, double ew, double t) {
double t_1 = atan(((-eh * tan(t)) / ew));
return fabs((((ew * cos(t)) * cos(t_1)) - ((eh * sin(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 * tan(t)) / ew))
code = abs((((ew * cos(t)) * cos(t_1)) - ((eh * sin(t)) * sin(t_1))))
end function
public static double code(double eh, double ew, double t) {
double t_1 = Math.atan(((-eh * Math.tan(t)) / ew));
return Math.abs((((ew * Math.cos(t)) * Math.cos(t_1)) - ((eh * Math.sin(t)) * Math.sin(t_1))));
}
def code(eh, ew, t): t_1 = math.atan(((-eh * math.tan(t)) / ew)) return math.fabs((((ew * math.cos(t)) * math.cos(t_1)) - ((eh * math.sin(t)) * math.sin(t_1))))
function code(eh, ew, t) t_1 = atan(Float64(Float64(Float64(-eh) * tan(t)) / ew)) return abs(Float64(Float64(Float64(ew * cos(t)) * cos(t_1)) - Float64(Float64(eh * sin(t)) * sin(t_1)))) end
function tmp = code(eh, ew, t) t_1 = atan(((-eh * tan(t)) / ew)); tmp = abs((((ew * cos(t)) * cos(t_1)) - ((eh * sin(t)) * 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[(N[(N[(ew * N[Cos[t], $MachinePrecision]), $MachinePrecision] * N[Cos[t$95$1], $MachinePrecision]), $MachinePrecision] - N[(N[(eh * N[Sin[t], $MachinePrecision]), $MachinePrecision] * N[Sin[t$95$1], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\\
\left|\left(ew \cdot \cos t\right) \cdot \cos t\_1 - \left(eh \cdot \sin t\right) \cdot \sin t\_1\right|
\end{array}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 14 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (eh ew t) :precision binary64 (let* ((t_1 (atan (/ (* (- eh) (tan t)) ew)))) (fabs (- (* (* ew (cos t)) (cos t_1)) (* (* eh (sin t)) (sin t_1))))))
double code(double eh, double ew, double t) {
double t_1 = atan(((-eh * tan(t)) / ew));
return fabs((((ew * cos(t)) * cos(t_1)) - ((eh * sin(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 * tan(t)) / ew))
code = abs((((ew * cos(t)) * cos(t_1)) - ((eh * sin(t)) * sin(t_1))))
end function
public static double code(double eh, double ew, double t) {
double t_1 = Math.atan(((-eh * Math.tan(t)) / ew));
return Math.abs((((ew * Math.cos(t)) * Math.cos(t_1)) - ((eh * Math.sin(t)) * Math.sin(t_1))));
}
def code(eh, ew, t): t_1 = math.atan(((-eh * math.tan(t)) / ew)) return math.fabs((((ew * math.cos(t)) * math.cos(t_1)) - ((eh * math.sin(t)) * math.sin(t_1))))
function code(eh, ew, t) t_1 = atan(Float64(Float64(Float64(-eh) * tan(t)) / ew)) return abs(Float64(Float64(Float64(ew * cos(t)) * cos(t_1)) - Float64(Float64(eh * sin(t)) * sin(t_1)))) end
function tmp = code(eh, ew, t) t_1 = atan(((-eh * tan(t)) / ew)); tmp = abs((((ew * cos(t)) * cos(t_1)) - ((eh * sin(t)) * 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[(N[(N[(ew * N[Cos[t], $MachinePrecision]), $MachinePrecision] * N[Cos[t$95$1], $MachinePrecision]), $MachinePrecision] - N[(N[(eh * N[Sin[t], $MachinePrecision]), $MachinePrecision] * N[Sin[t$95$1], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\\
\left|\left(ew \cdot \cos t\right) \cdot \cos t\_1 - \left(eh \cdot \sin t\right) \cdot \sin t\_1\right|
\end{array}
\end{array}
(FPCore (eh ew t) :precision binary64 (let* ((t_1 (atan (/ (* (- eh) (tan t)) ew)))) (fabs (- (* (* ew (cos t)) (cos t_1)) (* (* eh (sin t)) (sin t_1))))))
double code(double eh, double ew, double t) {
double t_1 = atan(((-eh * tan(t)) / ew));
return fabs((((ew * cos(t)) * cos(t_1)) - ((eh * sin(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 * tan(t)) / ew))
code = abs((((ew * cos(t)) * cos(t_1)) - ((eh * sin(t)) * sin(t_1))))
end function
public static double code(double eh, double ew, double t) {
double t_1 = Math.atan(((-eh * Math.tan(t)) / ew));
return Math.abs((((ew * Math.cos(t)) * Math.cos(t_1)) - ((eh * Math.sin(t)) * Math.sin(t_1))));
}
def code(eh, ew, t): t_1 = math.atan(((-eh * math.tan(t)) / ew)) return math.fabs((((ew * math.cos(t)) * math.cos(t_1)) - ((eh * math.sin(t)) * math.sin(t_1))))
function code(eh, ew, t) t_1 = atan(Float64(Float64(Float64(-eh) * tan(t)) / ew)) return abs(Float64(Float64(Float64(ew * cos(t)) * cos(t_1)) - Float64(Float64(eh * sin(t)) * sin(t_1)))) end
function tmp = code(eh, ew, t) t_1 = atan(((-eh * tan(t)) / ew)); tmp = abs((((ew * cos(t)) * cos(t_1)) - ((eh * sin(t)) * 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[(N[(N[(ew * N[Cos[t], $MachinePrecision]), $MachinePrecision] * N[Cos[t$95$1], $MachinePrecision]), $MachinePrecision] - N[(N[(eh * N[Sin[t], $MachinePrecision]), $MachinePrecision] * N[Sin[t$95$1], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\\
\left|\left(ew \cdot \cos t\right) \cdot \cos t\_1 - \left(eh \cdot \sin t\right) \cdot \sin t\_1\right|
\end{array}
\end{array}
Initial program 99.8%
(FPCore (eh ew t)
:precision binary64
(if (or (<= eh -7.2e-141) (not (<= eh 1.05e-106)))
(fabs
(*
eh
(-
(* (sin t) (sin (atan (* (- eh) (/ t ew)))))
(* ew (* (cos (atan (* (tan t) (/ (- eh) ew)))) (/ (cos t) eh))))))
(fabs (* ew (cos t)))))
double code(double eh, double ew, double t) {
double tmp;
if ((eh <= -7.2e-141) || !(eh <= 1.05e-106)) {
tmp = fabs((eh * ((sin(t) * sin(atan((-eh * (t / ew))))) - (ew * (cos(atan((tan(t) * (-eh / ew)))) * (cos(t) / eh))))));
} else {
tmp = fabs((ew * cos(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 <= (-7.2d-141)) .or. (.not. (eh <= 1.05d-106))) then
tmp = abs((eh * ((sin(t) * sin(atan((-eh * (t / ew))))) - (ew * (cos(atan((tan(t) * (-eh / ew)))) * (cos(t) / eh))))))
else
tmp = abs((ew * cos(t)))
end if
code = tmp
end function
public static double code(double eh, double ew, double t) {
double tmp;
if ((eh <= -7.2e-141) || !(eh <= 1.05e-106)) {
tmp = Math.abs((eh * ((Math.sin(t) * Math.sin(Math.atan((-eh * (t / ew))))) - (ew * (Math.cos(Math.atan((Math.tan(t) * (-eh / ew)))) * (Math.cos(t) / eh))))));
} else {
tmp = Math.abs((ew * Math.cos(t)));
}
return tmp;
}
def code(eh, ew, t): tmp = 0 if (eh <= -7.2e-141) or not (eh <= 1.05e-106): tmp = math.fabs((eh * ((math.sin(t) * math.sin(math.atan((-eh * (t / ew))))) - (ew * (math.cos(math.atan((math.tan(t) * (-eh / ew)))) * (math.cos(t) / eh)))))) else: tmp = math.fabs((ew * math.cos(t))) return tmp
function code(eh, ew, t) tmp = 0.0 if ((eh <= -7.2e-141) || !(eh <= 1.05e-106)) tmp = abs(Float64(eh * Float64(Float64(sin(t) * sin(atan(Float64(Float64(-eh) * Float64(t / ew))))) - Float64(ew * Float64(cos(atan(Float64(tan(t) * Float64(Float64(-eh) / ew)))) * Float64(cos(t) / eh)))))); else tmp = abs(Float64(ew * cos(t))); end return tmp end
function tmp_2 = code(eh, ew, t) tmp = 0.0; if ((eh <= -7.2e-141) || ~((eh <= 1.05e-106))) tmp = abs((eh * ((sin(t) * sin(atan((-eh * (t / ew))))) - (ew * (cos(atan((tan(t) * (-eh / ew)))) * (cos(t) / eh)))))); else tmp = abs((ew * cos(t))); end tmp_2 = tmp; end
code[eh_, ew_, t_] := If[Or[LessEqual[eh, -7.2e-141], N[Not[LessEqual[eh, 1.05e-106]], $MachinePrecision]], N[Abs[N[(eh * N[(N[(N[Sin[t], $MachinePrecision] * N[Sin[N[ArcTan[N[((-eh) * N[(t / ew), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - N[(ew * N[(N[Cos[N[ArcTan[N[(N[Tan[t], $MachinePrecision] * N[((-eh) / ew), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * N[(N[Cos[t], $MachinePrecision] / eh), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Abs[N[(ew * N[Cos[t], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;eh \leq -7.2 \cdot 10^{-141} \lor \neg \left(eh \leq 1.05 \cdot 10^{-106}\right):\\
\;\;\;\;\left|eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\left(-eh\right) \cdot \frac{t}{ew}\right) - ew \cdot \left(\cos \tan^{-1} \left(\tan t \cdot \frac{-eh}{ew}\right) \cdot \frac{\cos t}{eh}\right)\right)\right|\\
\mathbf{else}:\\
\;\;\;\;\left|ew \cdot \cos t\right|\\
\end{array}
\end{array}
if eh < -7.2000000000000003e-141 or 1.05000000000000002e-106 < eh Initial program 99.8%
fabs-sub99.8%
sub-neg99.8%
+-commutative99.8%
associate-*l*99.8%
distribute-rgt-neg-in99.8%
fma-define99.8%
Simplified99.8%
Taylor expanded in eh around inf 98.8%
+-commutative98.8%
mul-1-neg98.8%
unsub-neg98.8%
Simplified98.6%
Taylor expanded in t around 0 98.1%
mul-1-neg98.1%
associate-/l*98.1%
distribute-lft-neg-in98.1%
Simplified98.1%
if -7.2000000000000003e-141 < eh < 1.05000000000000002e-106Initial program 99.9%
fabs-sub99.9%
sub-neg99.9%
+-commutative99.9%
associate-*l*99.9%
distribute-rgt-neg-in99.9%
fma-define99.8%
Simplified99.8%
add-sqr-sqrt22.1%
sqrt-unprod99.9%
sqr-neg99.9%
sqrt-unprod77.6%
add-sqr-sqrt99.9%
associate-*r/99.9%
add-log-exp99.8%
associate-*r/99.8%
cos-atan99.8%
Applied egg-rr99.8%
Taylor expanded in ew around inf 89.5%
Final simplification95.7%
(FPCore (eh ew t)
:precision binary64
(let* ((t_1
(pow
(sqrt (fabs (* (* eh (sin t)) (sin (atan (* t (/ eh ew)))))))
2.0))
(t_2 (atan (* (tan t) (/ (- eh) ew))))
(t_3 (* (tan t) (/ eh ew))))
(if (<= t -1600000000.0)
t_1
(if (<= t 6500000.0)
(fabs (fma ew (cos t_2) (* (* t (- eh)) (sin t_2))))
(if (<= t 4.4e+118)
(+
(/ (* ew (cos t)) (hypot 1.0 t_3))
(* (sin t) (* eh (sin (atan t_3)))))
t_1)))))
double code(double eh, double ew, double t) {
double t_1 = pow(sqrt(fabs(((eh * sin(t)) * sin(atan((t * (eh / ew))))))), 2.0);
double t_2 = atan((tan(t) * (-eh / ew)));
double t_3 = tan(t) * (eh / ew);
double tmp;
if (t <= -1600000000.0) {
tmp = t_1;
} else if (t <= 6500000.0) {
tmp = fabs(fma(ew, cos(t_2), ((t * -eh) * sin(t_2))));
} else if (t <= 4.4e+118) {
tmp = ((ew * cos(t)) / hypot(1.0, t_3)) + (sin(t) * (eh * sin(atan(t_3))));
} else {
tmp = t_1;
}
return tmp;
}
function code(eh, ew, t) t_1 = sqrt(abs(Float64(Float64(eh * sin(t)) * sin(atan(Float64(t * Float64(eh / ew))))))) ^ 2.0 t_2 = atan(Float64(tan(t) * Float64(Float64(-eh) / ew))) t_3 = Float64(tan(t) * Float64(eh / ew)) tmp = 0.0 if (t <= -1600000000.0) tmp = t_1; elseif (t <= 6500000.0) tmp = abs(fma(ew, cos(t_2), Float64(Float64(t * Float64(-eh)) * sin(t_2)))); elseif (t <= 4.4e+118) tmp = Float64(Float64(Float64(ew * cos(t)) / hypot(1.0, t_3)) + Float64(sin(t) * Float64(eh * sin(atan(t_3))))); else tmp = t_1; end return tmp end
code[eh_, ew_, t_] := Block[{t$95$1 = N[Power[N[Sqrt[N[Abs[N[(N[(eh * N[Sin[t], $MachinePrecision]), $MachinePrecision] * N[Sin[N[ArcTan[N[(t * N[(eh / ew), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision], 2.0], $MachinePrecision]}, Block[{t$95$2 = N[ArcTan[N[(N[Tan[t], $MachinePrecision] * N[((-eh) / ew), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[(N[Tan[t], $MachinePrecision] * N[(eh / ew), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -1600000000.0], t$95$1, If[LessEqual[t, 6500000.0], N[Abs[N[(ew * N[Cos[t$95$2], $MachinePrecision] + N[(N[(t * (-eh)), $MachinePrecision] * N[Sin[t$95$2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[t, 4.4e+118], N[(N[(N[(ew * N[Cos[t], $MachinePrecision]), $MachinePrecision] / N[Sqrt[1.0 ^ 2 + t$95$3 ^ 2], $MachinePrecision]), $MachinePrecision] + N[(N[Sin[t], $MachinePrecision] * N[(eh * N[Sin[N[ArcTan[t$95$3], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := {\left(\sqrt{\left|\left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(t \cdot \frac{eh}{ew}\right)\right|}\right)}^{2}\\
t_2 := \tan^{-1} \left(\tan t \cdot \frac{-eh}{ew}\right)\\
t_3 := \tan t \cdot \frac{eh}{ew}\\
\mathbf{if}\;t \leq -1600000000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 6500000:\\
\;\;\;\;\left|\mathsf{fma}\left(ew, \cos t\_2, \left(t \cdot \left(-eh\right)\right) \cdot \sin t\_2\right)\right|\\
\mathbf{elif}\;t \leq 4.4 \cdot 10^{+118}:\\
\;\;\;\;\frac{ew \cdot \cos t}{\mathsf{hypot}\left(1, t\_3\right)} + \sin t \cdot \left(eh \cdot \sin \tan^{-1} t\_3\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -1.6e9 or 4.39999999999999972e118 < t Initial program 99.7%
Applied egg-rr48.5%
add-sqr-sqrt48.5%
pow1/248.5%
pow1/248.5%
pow-prod-down50.3%
Applied egg-rr50.3%
unpow1/250.3%
unpow250.3%
rem-sqrt-square99.2%
Simplified99.2%
Taylor expanded in t around 0 98.4%
Taylor expanded in eh around inf 60.4%
associate-*r/60.4%
associate-*l*60.4%
*-commutative60.4%
associate-*r/60.4%
*-commutative60.4%
associate-/l*60.4%
Simplified60.4%
if -1.6e9 < t < 6.5e6Initial program 100.0%
Taylor expanded in t around 0 97.8%
+-commutative97.8%
fma-define97.8%
associate-*r/97.8%
neg-mul-197.8%
*-commutative97.8%
distribute-lft-neg-in97.8%
associate-*r/97.8%
*-commutative97.8%
mul-1-neg97.8%
associate-*r*97.8%
distribute-lft-neg-in97.8%
Simplified97.8%
if 6.5e6 < t < 4.39999999999999972e118Initial program 99.6%
add-sqr-sqrt73.1%
fabs-sqr73.1%
add-sqr-sqrt73.6%
sub-neg73.6%
Applied egg-rr73.6%
Final simplification81.4%
(FPCore (eh ew t)
:precision binary64
(let* ((t_1
(pow
(sqrt (fabs (* (* eh (sin t)) (sin (atan (* t (/ eh ew)))))))
2.0))
(t_2 (atan (/ (* (- eh) (tan t)) ew)))
(t_3 (* (tan t) (/ eh ew))))
(if (<= t -1600000000.0)
t_1
(if (<= t 6500000.0)
(fabs (- (* eh (* t (sin t_2))) (* ew (cos t_2))))
(if (<= t 2.2e+117)
(+
(/ (* ew (cos t)) (hypot 1.0 t_3))
(* (sin t) (* eh (sin (atan t_3)))))
t_1)))))
double code(double eh, double ew, double t) {
double t_1 = pow(sqrt(fabs(((eh * sin(t)) * sin(atan((t * (eh / ew))))))), 2.0);
double t_2 = atan(((-eh * tan(t)) / ew));
double t_3 = tan(t) * (eh / ew);
double tmp;
if (t <= -1600000000.0) {
tmp = t_1;
} else if (t <= 6500000.0) {
tmp = fabs(((eh * (t * sin(t_2))) - (ew * cos(t_2))));
} else if (t <= 2.2e+117) {
tmp = ((ew * cos(t)) / hypot(1.0, t_3)) + (sin(t) * (eh * sin(atan(t_3))));
} else {
tmp = t_1;
}
return tmp;
}
public static double code(double eh, double ew, double t) {
double t_1 = Math.pow(Math.sqrt(Math.abs(((eh * Math.sin(t)) * Math.sin(Math.atan((t * (eh / ew))))))), 2.0);
double t_2 = Math.atan(((-eh * Math.tan(t)) / ew));
double t_3 = Math.tan(t) * (eh / ew);
double tmp;
if (t <= -1600000000.0) {
tmp = t_1;
} else if (t <= 6500000.0) {
tmp = Math.abs(((eh * (t * Math.sin(t_2))) - (ew * Math.cos(t_2))));
} else if (t <= 2.2e+117) {
tmp = ((ew * Math.cos(t)) / Math.hypot(1.0, t_3)) + (Math.sin(t) * (eh * Math.sin(Math.atan(t_3))));
} else {
tmp = t_1;
}
return tmp;
}
def code(eh, ew, t): t_1 = math.pow(math.sqrt(math.fabs(((eh * math.sin(t)) * math.sin(math.atan((t * (eh / ew))))))), 2.0) t_2 = math.atan(((-eh * math.tan(t)) / ew)) t_3 = math.tan(t) * (eh / ew) tmp = 0 if t <= -1600000000.0: tmp = t_1 elif t <= 6500000.0: tmp = math.fabs(((eh * (t * math.sin(t_2))) - (ew * math.cos(t_2)))) elif t <= 2.2e+117: tmp = ((ew * math.cos(t)) / math.hypot(1.0, t_3)) + (math.sin(t) * (eh * math.sin(math.atan(t_3)))) else: tmp = t_1 return tmp
function code(eh, ew, t) t_1 = sqrt(abs(Float64(Float64(eh * sin(t)) * sin(atan(Float64(t * Float64(eh / ew))))))) ^ 2.0 t_2 = atan(Float64(Float64(Float64(-eh) * tan(t)) / ew)) t_3 = Float64(tan(t) * Float64(eh / ew)) tmp = 0.0 if (t <= -1600000000.0) tmp = t_1; elseif (t <= 6500000.0) tmp = abs(Float64(Float64(eh * Float64(t * sin(t_2))) - Float64(ew * cos(t_2)))); elseif (t <= 2.2e+117) tmp = Float64(Float64(Float64(ew * cos(t)) / hypot(1.0, t_3)) + Float64(sin(t) * Float64(eh * sin(atan(t_3))))); else tmp = t_1; end return tmp end
function tmp_2 = code(eh, ew, t) t_1 = sqrt(abs(((eh * sin(t)) * sin(atan((t * (eh / ew))))))) ^ 2.0; t_2 = atan(((-eh * tan(t)) / ew)); t_3 = tan(t) * (eh / ew); tmp = 0.0; if (t <= -1600000000.0) tmp = t_1; elseif (t <= 6500000.0) tmp = abs(((eh * (t * sin(t_2))) - (ew * cos(t_2)))); elseif (t <= 2.2e+117) tmp = ((ew * cos(t)) / hypot(1.0, t_3)) + (sin(t) * (eh * sin(atan(t_3)))); else tmp = t_1; end tmp_2 = tmp; end
code[eh_, ew_, t_] := Block[{t$95$1 = N[Power[N[Sqrt[N[Abs[N[(N[(eh * N[Sin[t], $MachinePrecision]), $MachinePrecision] * N[Sin[N[ArcTan[N[(t * N[(eh / ew), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision], 2.0], $MachinePrecision]}, Block[{t$95$2 = N[ArcTan[N[(N[((-eh) * N[Tan[t], $MachinePrecision]), $MachinePrecision] / ew), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[(N[Tan[t], $MachinePrecision] * N[(eh / ew), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -1600000000.0], t$95$1, If[LessEqual[t, 6500000.0], N[Abs[N[(N[(eh * N[(t * N[Sin[t$95$2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(ew * N[Cos[t$95$2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[t, 2.2e+117], N[(N[(N[(ew * N[Cos[t], $MachinePrecision]), $MachinePrecision] / N[Sqrt[1.0 ^ 2 + t$95$3 ^ 2], $MachinePrecision]), $MachinePrecision] + N[(N[Sin[t], $MachinePrecision] * N[(eh * N[Sin[N[ArcTan[t$95$3], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := {\left(\sqrt{\left|\left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(t \cdot \frac{eh}{ew}\right)\right|}\right)}^{2}\\
t_2 := \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\\
t_3 := \tan t \cdot \frac{eh}{ew}\\
\mathbf{if}\;t \leq -1600000000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 6500000:\\
\;\;\;\;\left|eh \cdot \left(t \cdot \sin t\_2\right) - ew \cdot \cos t\_2\right|\\
\mathbf{elif}\;t \leq 2.2 \cdot 10^{+117}:\\
\;\;\;\;\frac{ew \cdot \cos t}{\mathsf{hypot}\left(1, t\_3\right)} + \sin t \cdot \left(eh \cdot \sin \tan^{-1} t\_3\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -1.6e9 or 2.20000000000000014e117 < t Initial program 99.7%
Applied egg-rr48.5%
add-sqr-sqrt48.5%
pow1/248.5%
pow1/248.5%
pow-prod-down50.3%
Applied egg-rr50.3%
unpow1/250.3%
unpow250.3%
rem-sqrt-square99.2%
Simplified99.2%
Taylor expanded in t around 0 98.4%
Taylor expanded in eh around inf 60.4%
associate-*r/60.4%
associate-*l*60.4%
*-commutative60.4%
associate-*r/60.4%
*-commutative60.4%
associate-/l*60.4%
Simplified60.4%
if -1.6e9 < t < 6.5e6Initial program 100.0%
fabs-sub100.0%
sub-neg100.0%
+-commutative100.0%
associate-*l*100.0%
distribute-rgt-neg-in100.0%
fma-define100.0%
Simplified100.0%
Taylor expanded in t around 0 97.8%
if 6.5e6 < t < 2.20000000000000014e117Initial program 99.6%
add-sqr-sqrt73.1%
fabs-sqr73.1%
add-sqr-sqrt73.6%
sub-neg73.6%
Applied egg-rr73.6%
Final simplification81.4%
(FPCore (eh ew t)
:precision binary64
(let* ((t_1 (* (tan t) (/ eh ew))) (t_2 (* ew (cos t))) (t_3 (fabs t_2)))
(if (<= ew -3.2e-104)
t_3
(if (<= ew 8.5e-213)
(fabs (* (sin t) (* eh (sin (atan (* (tan t) (/ (- eh) ew)))))))
(if (<= ew 1.4e+114)
(+ (/ t_2 (hypot 1.0 t_1)) (* (sin t) (* eh (sin (atan t_1)))))
t_3)))))
double code(double eh, double ew, double t) {
double t_1 = tan(t) * (eh / ew);
double t_2 = ew * cos(t);
double t_3 = fabs(t_2);
double tmp;
if (ew <= -3.2e-104) {
tmp = t_3;
} else if (ew <= 8.5e-213) {
tmp = fabs((sin(t) * (eh * sin(atan((tan(t) * (-eh / ew)))))));
} else if (ew <= 1.4e+114) {
tmp = (t_2 / hypot(1.0, t_1)) + (sin(t) * (eh * sin(atan(t_1))));
} else {
tmp = t_3;
}
return tmp;
}
public static double code(double eh, double ew, double t) {
double t_1 = Math.tan(t) * (eh / ew);
double t_2 = ew * Math.cos(t);
double t_3 = Math.abs(t_2);
double tmp;
if (ew <= -3.2e-104) {
tmp = t_3;
} else if (ew <= 8.5e-213) {
tmp = Math.abs((Math.sin(t) * (eh * Math.sin(Math.atan((Math.tan(t) * (-eh / ew)))))));
} else if (ew <= 1.4e+114) {
tmp = (t_2 / Math.hypot(1.0, t_1)) + (Math.sin(t) * (eh * Math.sin(Math.atan(t_1))));
} else {
tmp = t_3;
}
return tmp;
}
def code(eh, ew, t): t_1 = math.tan(t) * (eh / ew) t_2 = ew * math.cos(t) t_3 = math.fabs(t_2) tmp = 0 if ew <= -3.2e-104: tmp = t_3 elif ew <= 8.5e-213: tmp = math.fabs((math.sin(t) * (eh * math.sin(math.atan((math.tan(t) * (-eh / ew))))))) elif ew <= 1.4e+114: tmp = (t_2 / math.hypot(1.0, t_1)) + (math.sin(t) * (eh * math.sin(math.atan(t_1)))) else: tmp = t_3 return tmp
function code(eh, ew, t) t_1 = Float64(tan(t) * Float64(eh / ew)) t_2 = Float64(ew * cos(t)) t_3 = abs(t_2) tmp = 0.0 if (ew <= -3.2e-104) tmp = t_3; elseif (ew <= 8.5e-213) tmp = abs(Float64(sin(t) * Float64(eh * sin(atan(Float64(tan(t) * Float64(Float64(-eh) / ew))))))); elseif (ew <= 1.4e+114) tmp = Float64(Float64(t_2 / hypot(1.0, t_1)) + Float64(sin(t) * Float64(eh * sin(atan(t_1))))); else tmp = t_3; end return tmp end
function tmp_2 = code(eh, ew, t) t_1 = tan(t) * (eh / ew); t_2 = ew * cos(t); t_3 = abs(t_2); tmp = 0.0; if (ew <= -3.2e-104) tmp = t_3; elseif (ew <= 8.5e-213) tmp = abs((sin(t) * (eh * sin(atan((tan(t) * (-eh / ew))))))); elseif (ew <= 1.4e+114) tmp = (t_2 / hypot(1.0, t_1)) + (sin(t) * (eh * sin(atan(t_1)))); else tmp = t_3; end tmp_2 = tmp; end
code[eh_, ew_, t_] := Block[{t$95$1 = N[(N[Tan[t], $MachinePrecision] * N[(eh / ew), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(ew * N[Cos[t], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[Abs[t$95$2], $MachinePrecision]}, If[LessEqual[ew, -3.2e-104], t$95$3, If[LessEqual[ew, 8.5e-213], N[Abs[N[(N[Sin[t], $MachinePrecision] * N[(eh * N[Sin[N[ArcTan[N[(N[Tan[t], $MachinePrecision] * N[((-eh) / ew), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[ew, 1.4e+114], N[(N[(t$95$2 / N[Sqrt[1.0 ^ 2 + t$95$1 ^ 2], $MachinePrecision]), $MachinePrecision] + N[(N[Sin[t], $MachinePrecision] * N[(eh * N[Sin[N[ArcTan[t$95$1], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$3]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \tan t \cdot \frac{eh}{ew}\\
t_2 := ew \cdot \cos t\\
t_3 := \left|t\_2\right|\\
\mathbf{if}\;ew \leq -3.2 \cdot 10^{-104}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;ew \leq 8.5 \cdot 10^{-213}:\\
\;\;\;\;\left|\sin t \cdot \left(eh \cdot \sin \tan^{-1} \left(\tan t \cdot \frac{-eh}{ew}\right)\right)\right|\\
\mathbf{elif}\;ew \leq 1.4 \cdot 10^{+114}:\\
\;\;\;\;\frac{t\_2}{\mathsf{hypot}\left(1, t\_1\right)} + \sin t \cdot \left(eh \cdot \sin \tan^{-1} t\_1\right)\\
\mathbf{else}:\\
\;\;\;\;t\_3\\
\end{array}
\end{array}
if ew < -3.19999999999999989e-104 or 1.4e114 < ew Initial program 99.8%
fabs-sub99.8%
sub-neg99.8%
+-commutative99.8%
associate-*l*99.8%
distribute-rgt-neg-in99.8%
fma-define99.8%
Simplified99.8%
add-sqr-sqrt21.7%
sqrt-unprod99.2%
sqr-neg99.2%
sqrt-unprod77.3%
add-sqr-sqrt99.1%
associate-*r/99.1%
add-log-exp98.9%
associate-*r/98.9%
cos-atan98.9%
Applied egg-rr98.9%
Taylor expanded in ew around inf 82.9%
if -3.19999999999999989e-104 < ew < 8.49999999999999994e-213Initial program 99.8%
fabs-sub99.8%
sub-neg99.8%
+-commutative99.8%
associate-*l*99.8%
distribute-rgt-neg-in99.8%
fma-define99.8%
Simplified99.8%
Taylor expanded in ew around 0 84.0%
*-commutative84.0%
associate-*l*84.0%
*-commutative84.0%
associate-*r/84.0%
neg-mul-184.0%
*-commutative84.0%
distribute-lft-neg-in84.0%
associate-*r/84.0%
*-commutative84.0%
Simplified84.0%
if 8.49999999999999994e-213 < ew < 1.4e114Initial program 99.8%
add-sqr-sqrt74.4%
fabs-sqr74.4%
add-sqr-sqrt75.2%
sub-neg75.2%
Applied egg-rr75.2%
Final simplification81.3%
(FPCore (eh ew t)
:precision binary64
(let* ((t_1 (* ew (cos t))) (t_2 (fabs t_1)))
(if (<= ew -1.45e-107)
t_2
(if (<= ew 8.2e-213)
(fabs (* (sin t) (* eh (sin (atan (* (tan t) (/ (- eh) ew)))))))
(if (<= ew 3.7e+114)
(+ t_1 (* eh (* (sin t) (sin (atan (/ (* eh (tan t)) ew))))))
t_2)))))
double code(double eh, double ew, double t) {
double t_1 = ew * cos(t);
double t_2 = fabs(t_1);
double tmp;
if (ew <= -1.45e-107) {
tmp = t_2;
} else if (ew <= 8.2e-213) {
tmp = fabs((sin(t) * (eh * sin(atan((tan(t) * (-eh / ew)))))));
} else if (ew <= 3.7e+114) {
tmp = t_1 + (eh * (sin(t) * sin(atan(((eh * tan(t)) / ew)))));
} else {
tmp = t_2;
}
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 = ew * cos(t)
t_2 = abs(t_1)
if (ew <= (-1.45d-107)) then
tmp = t_2
else if (ew <= 8.2d-213) then
tmp = abs((sin(t) * (eh * sin(atan((tan(t) * (-eh / ew)))))))
else if (ew <= 3.7d+114) then
tmp = t_1 + (eh * (sin(t) * sin(atan(((eh * tan(t)) / ew)))))
else
tmp = t_2
end if
code = tmp
end function
public static double code(double eh, double ew, double t) {
double t_1 = ew * Math.cos(t);
double t_2 = Math.abs(t_1);
double tmp;
if (ew <= -1.45e-107) {
tmp = t_2;
} else if (ew <= 8.2e-213) {
tmp = Math.abs((Math.sin(t) * (eh * Math.sin(Math.atan((Math.tan(t) * (-eh / ew)))))));
} else if (ew <= 3.7e+114) {
tmp = t_1 + (eh * (Math.sin(t) * Math.sin(Math.atan(((eh * Math.tan(t)) / ew)))));
} else {
tmp = t_2;
}
return tmp;
}
def code(eh, ew, t): t_1 = ew * math.cos(t) t_2 = math.fabs(t_1) tmp = 0 if ew <= -1.45e-107: tmp = t_2 elif ew <= 8.2e-213: tmp = math.fabs((math.sin(t) * (eh * math.sin(math.atan((math.tan(t) * (-eh / ew))))))) elif ew <= 3.7e+114: tmp = t_1 + (eh * (math.sin(t) * math.sin(math.atan(((eh * math.tan(t)) / ew))))) else: tmp = t_2 return tmp
function code(eh, ew, t) t_1 = Float64(ew * cos(t)) t_2 = abs(t_1) tmp = 0.0 if (ew <= -1.45e-107) tmp = t_2; elseif (ew <= 8.2e-213) tmp = abs(Float64(sin(t) * Float64(eh * sin(atan(Float64(tan(t) * Float64(Float64(-eh) / ew))))))); elseif (ew <= 3.7e+114) tmp = Float64(t_1 + Float64(eh * Float64(sin(t) * sin(atan(Float64(Float64(eh * tan(t)) / ew)))))); else tmp = t_2; end return tmp end
function tmp_2 = code(eh, ew, t) t_1 = ew * cos(t); t_2 = abs(t_1); tmp = 0.0; if (ew <= -1.45e-107) tmp = t_2; elseif (ew <= 8.2e-213) tmp = abs((sin(t) * (eh * sin(atan((tan(t) * (-eh / ew))))))); elseif (ew <= 3.7e+114) tmp = t_1 + (eh * (sin(t) * sin(atan(((eh * tan(t)) / ew))))); else tmp = t_2; end tmp_2 = tmp; end
code[eh_, ew_, t_] := Block[{t$95$1 = N[(ew * N[Cos[t], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Abs[t$95$1], $MachinePrecision]}, If[LessEqual[ew, -1.45e-107], t$95$2, If[LessEqual[ew, 8.2e-213], N[Abs[N[(N[Sin[t], $MachinePrecision] * N[(eh * N[Sin[N[ArcTan[N[(N[Tan[t], $MachinePrecision] * N[((-eh) / ew), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[ew, 3.7e+114], N[(t$95$1 + N[(eh * N[(N[Sin[t], $MachinePrecision] * N[Sin[N[ArcTan[N[(N[(eh * N[Tan[t], $MachinePrecision]), $MachinePrecision] / ew), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$2]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := ew \cdot \cos t\\
t_2 := \left|t\_1\right|\\
\mathbf{if}\;ew \leq -1.45 \cdot 10^{-107}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;ew \leq 8.2 \cdot 10^{-213}:\\
\;\;\;\;\left|\sin t \cdot \left(eh \cdot \sin \tan^{-1} \left(\tan t \cdot \frac{-eh}{ew}\right)\right)\right|\\
\mathbf{elif}\;ew \leq 3.7 \cdot 10^{+114}:\\
\;\;\;\;t\_1 + eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\frac{eh \cdot \tan t}{ew}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if ew < -1.4499999999999999e-107 or 3.7000000000000001e114 < ew Initial program 99.8%
fabs-sub99.8%
sub-neg99.8%
+-commutative99.8%
associate-*l*99.8%
distribute-rgt-neg-in99.8%
fma-define99.8%
Simplified99.8%
add-sqr-sqrt21.7%
sqrt-unprod99.2%
sqr-neg99.2%
sqrt-unprod77.3%
add-sqr-sqrt99.1%
associate-*r/99.1%
add-log-exp98.9%
associate-*r/98.9%
cos-atan98.9%
Applied egg-rr98.9%
Taylor expanded in ew around inf 82.9%
if -1.4499999999999999e-107 < ew < 8.19999999999999949e-213Initial program 99.8%
fabs-sub99.8%
sub-neg99.8%
+-commutative99.8%
associate-*l*99.8%
distribute-rgt-neg-in99.8%
fma-define99.8%
Simplified99.8%
Taylor expanded in ew around 0 84.0%
*-commutative84.0%
associate-*l*84.0%
*-commutative84.0%
associate-*r/84.0%
neg-mul-184.0%
*-commutative84.0%
distribute-lft-neg-in84.0%
associate-*r/84.0%
*-commutative84.0%
Simplified84.0%
if 8.19999999999999949e-213 < ew < 3.7000000000000001e114Initial program 99.8%
Applied egg-rr74.4%
Taylor expanded in eh around 0 75.2%
Final simplification81.3%
(FPCore (eh ew t) :precision binary64 (if (or (<= ew -5.2e-104) (not (<= ew 6.4e-49))) (fabs (* ew (cos t))) (fabs (* (sin t) (* eh (sin (atan (* (tan t) (/ (- eh) ew)))))))))
double code(double eh, double ew, double t) {
double tmp;
if ((ew <= -5.2e-104) || !(ew <= 6.4e-49)) {
tmp = fabs((ew * cos(t)));
} else {
tmp = fabs((sin(t) * (eh * sin(atan((tan(t) * (-eh / ew)))))));
}
return tmp;
}
real(8) function code(eh, ew, t)
real(8), intent (in) :: eh
real(8), intent (in) :: ew
real(8), intent (in) :: t
real(8) :: tmp
if ((ew <= (-5.2d-104)) .or. (.not. (ew <= 6.4d-49))) then
tmp = abs((ew * cos(t)))
else
tmp = abs((sin(t) * (eh * sin(atan((tan(t) * (-eh / ew)))))))
end if
code = tmp
end function
public static double code(double eh, double ew, double t) {
double tmp;
if ((ew <= -5.2e-104) || !(ew <= 6.4e-49)) {
tmp = Math.abs((ew * Math.cos(t)));
} else {
tmp = Math.abs((Math.sin(t) * (eh * Math.sin(Math.atan((Math.tan(t) * (-eh / ew)))))));
}
return tmp;
}
def code(eh, ew, t): tmp = 0 if (ew <= -5.2e-104) or not (ew <= 6.4e-49): tmp = math.fabs((ew * math.cos(t))) else: tmp = math.fabs((math.sin(t) * (eh * math.sin(math.atan((math.tan(t) * (-eh / ew))))))) return tmp
function code(eh, ew, t) tmp = 0.0 if ((ew <= -5.2e-104) || !(ew <= 6.4e-49)) tmp = abs(Float64(ew * cos(t))); else tmp = abs(Float64(sin(t) * Float64(eh * sin(atan(Float64(tan(t) * Float64(Float64(-eh) / ew))))))); end return tmp end
function tmp_2 = code(eh, ew, t) tmp = 0.0; if ((ew <= -5.2e-104) || ~((ew <= 6.4e-49))) tmp = abs((ew * cos(t))); else tmp = abs((sin(t) * (eh * sin(atan((tan(t) * (-eh / ew))))))); end tmp_2 = tmp; end
code[eh_, ew_, t_] := If[Or[LessEqual[ew, -5.2e-104], N[Not[LessEqual[ew, 6.4e-49]], $MachinePrecision]], N[Abs[N[(ew * N[Cos[t], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Abs[N[(N[Sin[t], $MachinePrecision] * N[(eh * N[Sin[N[ArcTan[N[(N[Tan[t], $MachinePrecision] * N[((-eh) / ew), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;ew \leq -5.2 \cdot 10^{-104} \lor \neg \left(ew \leq 6.4 \cdot 10^{-49}\right):\\
\;\;\;\;\left|ew \cdot \cos t\right|\\
\mathbf{else}:\\
\;\;\;\;\left|\sin t \cdot \left(eh \cdot \sin \tan^{-1} \left(\tan t \cdot \frac{-eh}{ew}\right)\right)\right|\\
\end{array}
\end{array}
if ew < -5.20000000000000005e-104 or 6.40000000000000005e-49 < ew Initial program 99.8%
fabs-sub99.8%
sub-neg99.8%
+-commutative99.8%
associate-*l*99.8%
distribute-rgt-neg-in99.8%
fma-define99.8%
Simplified99.8%
add-sqr-sqrt22.3%
sqrt-unprod99.3%
sqr-neg99.3%
sqrt-unprod76.9%
add-sqr-sqrt99.3%
associate-*r/99.3%
add-log-exp99.1%
associate-*r/99.1%
cos-atan99.1%
Applied egg-rr99.1%
Taylor expanded in ew around inf 78.5%
if -5.20000000000000005e-104 < ew < 6.40000000000000005e-49Initial program 99.8%
fabs-sub99.8%
sub-neg99.8%
+-commutative99.8%
associate-*l*99.8%
distribute-rgt-neg-in99.8%
fma-define99.8%
Simplified99.8%
Taylor expanded in ew around 0 80.7%
*-commutative80.7%
associate-*l*80.7%
*-commutative80.7%
associate-*r/80.7%
neg-mul-180.7%
*-commutative80.7%
distribute-lft-neg-in80.7%
associate-*r/80.7%
*-commutative80.7%
Simplified80.7%
Final simplification79.4%
(FPCore (eh ew t)
:precision binary64
(let* ((t_1 (fabs (* ew (cos t)))))
(if (<= ew -1.2e-133)
t_1
(if (<= ew -3.4e-299)
(fabs (* eh (* t (sin (atan (* (tan t) (/ (- eh) ew)))))))
(if (<= ew 3.8e-50)
(* (* eh (sin t)) (sin (atan (* (tan t) (/ eh ew)))))
t_1)))))
double code(double eh, double ew, double t) {
double t_1 = fabs((ew * cos(t)));
double tmp;
if (ew <= -1.2e-133) {
tmp = t_1;
} else if (ew <= -3.4e-299) {
tmp = fabs((eh * (t * sin(atan((tan(t) * (-eh / ew)))))));
} else if (ew <= 3.8e-50) {
tmp = (eh * sin(t)) * sin(atan((tan(t) * (eh / ew))));
} else {
tmp = 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 = abs((ew * cos(t)))
if (ew <= (-1.2d-133)) then
tmp = t_1
else if (ew <= (-3.4d-299)) then
tmp = abs((eh * (t * sin(atan((tan(t) * (-eh / ew)))))))
else if (ew <= 3.8d-50) then
tmp = (eh * sin(t)) * sin(atan((tan(t) * (eh / ew))))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double eh, double ew, double t) {
double t_1 = Math.abs((ew * Math.cos(t)));
double tmp;
if (ew <= -1.2e-133) {
tmp = t_1;
} else if (ew <= -3.4e-299) {
tmp = Math.abs((eh * (t * Math.sin(Math.atan((Math.tan(t) * (-eh / ew)))))));
} else if (ew <= 3.8e-50) {
tmp = (eh * Math.sin(t)) * Math.sin(Math.atan((Math.tan(t) * (eh / ew))));
} else {
tmp = t_1;
}
return tmp;
}
def code(eh, ew, t): t_1 = math.fabs((ew * math.cos(t))) tmp = 0 if ew <= -1.2e-133: tmp = t_1 elif ew <= -3.4e-299: tmp = math.fabs((eh * (t * math.sin(math.atan((math.tan(t) * (-eh / ew))))))) elif ew <= 3.8e-50: tmp = (eh * math.sin(t)) * math.sin(math.atan((math.tan(t) * (eh / ew)))) else: tmp = t_1 return tmp
function code(eh, ew, t) t_1 = abs(Float64(ew * cos(t))) tmp = 0.0 if (ew <= -1.2e-133) tmp = t_1; elseif (ew <= -3.4e-299) tmp = abs(Float64(eh * Float64(t * sin(atan(Float64(tan(t) * Float64(Float64(-eh) / ew))))))); elseif (ew <= 3.8e-50) tmp = Float64(Float64(eh * sin(t)) * sin(atan(Float64(tan(t) * Float64(eh / ew))))); else tmp = t_1; end return tmp end
function tmp_2 = code(eh, ew, t) t_1 = abs((ew * cos(t))); tmp = 0.0; if (ew <= -1.2e-133) tmp = t_1; elseif (ew <= -3.4e-299) tmp = abs((eh * (t * sin(atan((tan(t) * (-eh / ew))))))); elseif (ew <= 3.8e-50) tmp = (eh * sin(t)) * sin(atan((tan(t) * (eh / ew)))); else tmp = t_1; end tmp_2 = tmp; end
code[eh_, ew_, t_] := Block[{t$95$1 = N[Abs[N[(ew * N[Cos[t], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[ew, -1.2e-133], t$95$1, If[LessEqual[ew, -3.4e-299], N[Abs[N[(eh * N[(t * N[Sin[N[ArcTan[N[(N[Tan[t], $MachinePrecision] * N[((-eh) / ew), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[ew, 3.8e-50], N[(N[(eh * N[Sin[t], $MachinePrecision]), $MachinePrecision] * N[Sin[N[ArcTan[N[(N[Tan[t], $MachinePrecision] * N[(eh / ew), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left|ew \cdot \cos t\right|\\
\mathbf{if}\;ew \leq -1.2 \cdot 10^{-133}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;ew \leq -3.4 \cdot 10^{-299}:\\
\;\;\;\;\left|eh \cdot \left(t \cdot \sin \tan^{-1} \left(\tan t \cdot \frac{-eh}{ew}\right)\right)\right|\\
\mathbf{elif}\;ew \leq 3.8 \cdot 10^{-50}:\\
\;\;\;\;\left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\tan t \cdot \frac{eh}{ew}\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if ew < -1.2e-133 or 3.7999999999999999e-50 < ew Initial program 99.8%
fabs-sub99.8%
sub-neg99.8%
+-commutative99.8%
associate-*l*99.8%
distribute-rgt-neg-in99.8%
fma-define99.8%
Simplified99.8%
add-sqr-sqrt22.8%
sqrt-unprod99.4%
sqr-neg99.4%
sqrt-unprod76.4%
add-sqr-sqrt99.3%
associate-*r/99.3%
add-log-exp99.1%
associate-*r/99.1%
cos-atan99.1%
Applied egg-rr99.1%
Taylor expanded in ew around inf 77.4%
if -1.2e-133 < ew < -3.3999999999999998e-299Initial program 99.8%
fabs-sub99.8%
sub-neg99.8%
+-commutative99.8%
associate-*l*99.8%
distribute-rgt-neg-in99.8%
fma-define99.8%
Simplified99.8%
Taylor expanded in t around 0 70.5%
Taylor expanded in ew around 0 56.2%
mul-1-neg56.2%
associate-*l/56.2%
*-commutative56.2%
distribute-rgt-neg-in56.2%
distribute-frac-neg56.2%
Simplified56.2%
if -3.3999999999999998e-299 < ew < 3.7999999999999999e-50Initial program 99.8%
Applied egg-rr73.6%
Taylor expanded in eh around inf 60.4%
associate-*l/60.4%
*-commutative60.4%
associate-*l*60.4%
Simplified60.4%
(FPCore (eh ew t)
:precision binary64
(let* ((t_1 (fabs (* ew (cos t)))))
(if (<= ew -6.3e-133)
t_1
(if (<= ew -4.5e-300)
(fabs (* eh (* t (sin (atan (* t (/ (- eh) ew)))))))
(if (<= ew 3.8e-50)
(* (* eh (sin t)) (sin (atan (* (tan t) (/ eh ew)))))
t_1)))))
double code(double eh, double ew, double t) {
double t_1 = fabs((ew * cos(t)));
double tmp;
if (ew <= -6.3e-133) {
tmp = t_1;
} else if (ew <= -4.5e-300) {
tmp = fabs((eh * (t * sin(atan((t * (-eh / ew)))))));
} else if (ew <= 3.8e-50) {
tmp = (eh * sin(t)) * sin(atan((tan(t) * (eh / ew))));
} else {
tmp = 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 = abs((ew * cos(t)))
if (ew <= (-6.3d-133)) then
tmp = t_1
else if (ew <= (-4.5d-300)) then
tmp = abs((eh * (t * sin(atan((t * (-eh / ew)))))))
else if (ew <= 3.8d-50) then
tmp = (eh * sin(t)) * sin(atan((tan(t) * (eh / ew))))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double eh, double ew, double t) {
double t_1 = Math.abs((ew * Math.cos(t)));
double tmp;
if (ew <= -6.3e-133) {
tmp = t_1;
} else if (ew <= -4.5e-300) {
tmp = Math.abs((eh * (t * Math.sin(Math.atan((t * (-eh / ew)))))));
} else if (ew <= 3.8e-50) {
tmp = (eh * Math.sin(t)) * Math.sin(Math.atan((Math.tan(t) * (eh / ew))));
} else {
tmp = t_1;
}
return tmp;
}
def code(eh, ew, t): t_1 = math.fabs((ew * math.cos(t))) tmp = 0 if ew <= -6.3e-133: tmp = t_1 elif ew <= -4.5e-300: tmp = math.fabs((eh * (t * math.sin(math.atan((t * (-eh / ew))))))) elif ew <= 3.8e-50: tmp = (eh * math.sin(t)) * math.sin(math.atan((math.tan(t) * (eh / ew)))) else: tmp = t_1 return tmp
function code(eh, ew, t) t_1 = abs(Float64(ew * cos(t))) tmp = 0.0 if (ew <= -6.3e-133) tmp = t_1; elseif (ew <= -4.5e-300) tmp = abs(Float64(eh * Float64(t * sin(atan(Float64(t * Float64(Float64(-eh) / ew))))))); elseif (ew <= 3.8e-50) tmp = Float64(Float64(eh * sin(t)) * sin(atan(Float64(tan(t) * Float64(eh / ew))))); else tmp = t_1; end return tmp end
function tmp_2 = code(eh, ew, t) t_1 = abs((ew * cos(t))); tmp = 0.0; if (ew <= -6.3e-133) tmp = t_1; elseif (ew <= -4.5e-300) tmp = abs((eh * (t * sin(atan((t * (-eh / ew))))))); elseif (ew <= 3.8e-50) tmp = (eh * sin(t)) * sin(atan((tan(t) * (eh / ew)))); else tmp = t_1; end tmp_2 = tmp; end
code[eh_, ew_, t_] := Block[{t$95$1 = N[Abs[N[(ew * N[Cos[t], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[ew, -6.3e-133], t$95$1, If[LessEqual[ew, -4.5e-300], N[Abs[N[(eh * N[(t * N[Sin[N[ArcTan[N[(t * N[((-eh) / ew), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[ew, 3.8e-50], N[(N[(eh * N[Sin[t], $MachinePrecision]), $MachinePrecision] * N[Sin[N[ArcTan[N[(N[Tan[t], $MachinePrecision] * N[(eh / ew), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left|ew \cdot \cos t\right|\\
\mathbf{if}\;ew \leq -6.3 \cdot 10^{-133}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;ew \leq -4.5 \cdot 10^{-300}:\\
\;\;\;\;\left|eh \cdot \left(t \cdot \sin \tan^{-1} \left(t \cdot \frac{-eh}{ew}\right)\right)\right|\\
\mathbf{elif}\;ew \leq 3.8 \cdot 10^{-50}:\\
\;\;\;\;\left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\tan t \cdot \frac{eh}{ew}\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if ew < -6.3000000000000003e-133 or 3.7999999999999999e-50 < ew Initial program 99.8%
fabs-sub99.8%
sub-neg99.8%
+-commutative99.8%
associate-*l*99.8%
distribute-rgt-neg-in99.8%
fma-define99.8%
Simplified99.8%
add-sqr-sqrt22.8%
sqrt-unprod99.4%
sqr-neg99.4%
sqrt-unprod76.4%
add-sqr-sqrt99.3%
associate-*r/99.3%
add-log-exp99.1%
associate-*r/99.1%
cos-atan99.1%
Applied egg-rr99.1%
Taylor expanded in ew around inf 77.4%
if -6.3000000000000003e-133 < ew < -4.5e-300Initial program 99.8%
fabs-sub99.8%
sub-neg99.8%
+-commutative99.8%
associate-*l*99.8%
distribute-rgt-neg-in99.8%
fma-define99.8%
Simplified99.8%
Taylor expanded in t around 0 70.5%
Taylor expanded in ew around 0 56.2%
mul-1-neg56.2%
associate-*l/56.2%
*-commutative56.2%
distribute-rgt-neg-in56.2%
distribute-frac-neg56.2%
Simplified56.2%
Taylor expanded in t around 0 56.2%
associate-*r/56.2%
associate-*r*56.2%
neg-mul-156.2%
associate-*l/56.2%
*-commutative56.2%
Simplified56.2%
if -4.5e-300 < ew < 3.7999999999999999e-50Initial program 99.8%
Applied egg-rr73.6%
Taylor expanded in eh around inf 60.4%
associate-*l/60.4%
*-commutative60.4%
associate-*l*60.4%
Simplified60.4%
(FPCore (eh ew t)
:precision binary64
(let* ((t_1 (fabs (* ew (cos t)))))
(if (<= ew -8.8e-134)
t_1
(if (<= ew -4e-310)
(fabs (* eh (* t (sin (atan (* t (/ (- eh) ew)))))))
(if (<= ew 8.2e-75)
(+ ew (* eh (* t (sin (atan (/ (* eh (tan t)) ew))))))
t_1)))))
double code(double eh, double ew, double t) {
double t_1 = fabs((ew * cos(t)));
double tmp;
if (ew <= -8.8e-134) {
tmp = t_1;
} else if (ew <= -4e-310) {
tmp = fabs((eh * (t * sin(atan((t * (-eh / ew)))))));
} else if (ew <= 8.2e-75) {
tmp = ew + (eh * (t * sin(atan(((eh * tan(t)) / ew)))));
} else {
tmp = 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 = abs((ew * cos(t)))
if (ew <= (-8.8d-134)) then
tmp = t_1
else if (ew <= (-4d-310)) then
tmp = abs((eh * (t * sin(atan((t * (-eh / ew)))))))
else if (ew <= 8.2d-75) then
tmp = ew + (eh * (t * sin(atan(((eh * tan(t)) / ew)))))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double eh, double ew, double t) {
double t_1 = Math.abs((ew * Math.cos(t)));
double tmp;
if (ew <= -8.8e-134) {
tmp = t_1;
} else if (ew <= -4e-310) {
tmp = Math.abs((eh * (t * Math.sin(Math.atan((t * (-eh / ew)))))));
} else if (ew <= 8.2e-75) {
tmp = ew + (eh * (t * Math.sin(Math.atan(((eh * Math.tan(t)) / ew)))));
} else {
tmp = t_1;
}
return tmp;
}
def code(eh, ew, t): t_1 = math.fabs((ew * math.cos(t))) tmp = 0 if ew <= -8.8e-134: tmp = t_1 elif ew <= -4e-310: tmp = math.fabs((eh * (t * math.sin(math.atan((t * (-eh / ew))))))) elif ew <= 8.2e-75: tmp = ew + (eh * (t * math.sin(math.atan(((eh * math.tan(t)) / ew))))) else: tmp = t_1 return tmp
function code(eh, ew, t) t_1 = abs(Float64(ew * cos(t))) tmp = 0.0 if (ew <= -8.8e-134) tmp = t_1; elseif (ew <= -4e-310) tmp = abs(Float64(eh * Float64(t * sin(atan(Float64(t * Float64(Float64(-eh) / ew))))))); elseif (ew <= 8.2e-75) tmp = Float64(ew + Float64(eh * Float64(t * sin(atan(Float64(Float64(eh * tan(t)) / ew)))))); else tmp = t_1; end return tmp end
function tmp_2 = code(eh, ew, t) t_1 = abs((ew * cos(t))); tmp = 0.0; if (ew <= -8.8e-134) tmp = t_1; elseif (ew <= -4e-310) tmp = abs((eh * (t * sin(atan((t * (-eh / ew))))))); elseif (ew <= 8.2e-75) tmp = ew + (eh * (t * sin(atan(((eh * tan(t)) / ew))))); else tmp = t_1; end tmp_2 = tmp; end
code[eh_, ew_, t_] := Block[{t$95$1 = N[Abs[N[(ew * N[Cos[t], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[ew, -8.8e-134], t$95$1, If[LessEqual[ew, -4e-310], N[Abs[N[(eh * N[(t * N[Sin[N[ArcTan[N[(t * N[((-eh) / ew), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[ew, 8.2e-75], N[(ew + N[(eh * N[(t * N[Sin[N[ArcTan[N[(N[(eh * N[Tan[t], $MachinePrecision]), $MachinePrecision] / ew), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left|ew \cdot \cos t\right|\\
\mathbf{if}\;ew \leq -8.8 \cdot 10^{-134}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;ew \leq -4 \cdot 10^{-310}:\\
\;\;\;\;\left|eh \cdot \left(t \cdot \sin \tan^{-1} \left(t \cdot \frac{-eh}{ew}\right)\right)\right|\\
\mathbf{elif}\;ew \leq 8.2 \cdot 10^{-75}:\\
\;\;\;\;ew + eh \cdot \left(t \cdot \sin \tan^{-1} \left(\frac{eh \cdot \tan t}{ew}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if ew < -8.7999999999999999e-134 or 8.20000000000000005e-75 < ew Initial program 99.8%
fabs-sub99.8%
sub-neg99.8%
+-commutative99.8%
associate-*l*99.8%
distribute-rgt-neg-in99.8%
fma-define99.8%
Simplified99.8%
add-sqr-sqrt23.0%
sqrt-unprod99.4%
sqr-neg99.4%
sqrt-unprod76.2%
add-sqr-sqrt99.3%
associate-*r/99.3%
add-log-exp99.1%
associate-*r/99.1%
cos-atan99.1%
Applied egg-rr99.1%
Taylor expanded in ew around inf 76.0%
if -8.7999999999999999e-134 < ew < -3.999999999999988e-310Initial program 99.8%
fabs-sub99.8%
sub-neg99.8%
+-commutative99.8%
associate-*l*99.8%
distribute-rgt-neg-in99.8%
fma-define99.8%
Simplified99.8%
Taylor expanded in t around 0 69.7%
Taylor expanded in ew around 0 53.9%
mul-1-neg53.9%
associate-*l/53.9%
*-commutative53.9%
distribute-rgt-neg-in53.9%
distribute-frac-neg53.9%
Simplified53.9%
Taylor expanded in t around 0 53.9%
associate-*r/53.9%
associate-*r*53.9%
neg-mul-153.9%
associate-*l/53.9%
*-commutative53.9%
Simplified53.9%
if -3.999999999999988e-310 < ew < 8.20000000000000005e-75Initial program 99.9%
Applied egg-rr75.0%
Taylor expanded in t around 0 49.5%
(FPCore (eh ew t) :precision binary64 (if (or (<= ew -2.7e-132) (not (<= ew 7e-184))) (fabs (* ew (cos t))) (fabs (* eh (* t (sin (atan (* t (/ (- eh) ew)))))))))
double code(double eh, double ew, double t) {
double tmp;
if ((ew <= -2.7e-132) || !(ew <= 7e-184)) {
tmp = fabs((ew * cos(t)));
} else {
tmp = fabs((eh * (t * sin(atan((t * (-eh / ew)))))));
}
return tmp;
}
real(8) function code(eh, ew, t)
real(8), intent (in) :: eh
real(8), intent (in) :: ew
real(8), intent (in) :: t
real(8) :: tmp
if ((ew <= (-2.7d-132)) .or. (.not. (ew <= 7d-184))) then
tmp = abs((ew * cos(t)))
else
tmp = abs((eh * (t * sin(atan((t * (-eh / ew)))))))
end if
code = tmp
end function
public static double code(double eh, double ew, double t) {
double tmp;
if ((ew <= -2.7e-132) || !(ew <= 7e-184)) {
tmp = Math.abs((ew * Math.cos(t)));
} else {
tmp = Math.abs((eh * (t * Math.sin(Math.atan((t * (-eh / ew)))))));
}
return tmp;
}
def code(eh, ew, t): tmp = 0 if (ew <= -2.7e-132) or not (ew <= 7e-184): tmp = math.fabs((ew * math.cos(t))) else: tmp = math.fabs((eh * (t * math.sin(math.atan((t * (-eh / ew))))))) return tmp
function code(eh, ew, t) tmp = 0.0 if ((ew <= -2.7e-132) || !(ew <= 7e-184)) tmp = abs(Float64(ew * cos(t))); else tmp = abs(Float64(eh * Float64(t * sin(atan(Float64(t * Float64(Float64(-eh) / ew))))))); end return tmp end
function tmp_2 = code(eh, ew, t) tmp = 0.0; if ((ew <= -2.7e-132) || ~((ew <= 7e-184))) tmp = abs((ew * cos(t))); else tmp = abs((eh * (t * sin(atan((t * (-eh / ew))))))); end tmp_2 = tmp; end
code[eh_, ew_, t_] := If[Or[LessEqual[ew, -2.7e-132], N[Not[LessEqual[ew, 7e-184]], $MachinePrecision]], N[Abs[N[(ew * N[Cos[t], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Abs[N[(eh * N[(t * N[Sin[N[ArcTan[N[(t * N[((-eh) / ew), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;ew \leq -2.7 \cdot 10^{-132} \lor \neg \left(ew \leq 7 \cdot 10^{-184}\right):\\
\;\;\;\;\left|ew \cdot \cos t\right|\\
\mathbf{else}:\\
\;\;\;\;\left|eh \cdot \left(t \cdot \sin \tan^{-1} \left(t \cdot \frac{-eh}{ew}\right)\right)\right|\\
\end{array}
\end{array}
if ew < -2.6999999999999999e-132 or 6.99999999999999962e-184 < ew Initial program 99.8%
fabs-sub99.8%
sub-neg99.8%
+-commutative99.8%
associate-*l*99.8%
distribute-rgt-neg-in99.8%
fma-define99.8%
Simplified99.8%
add-sqr-sqrt23.6%
sqrt-unprod99.4%
sqr-neg99.4%
sqrt-unprod75.7%
add-sqr-sqrt99.4%
associate-*r/99.4%
add-log-exp99.2%
associate-*r/99.2%
cos-atan99.2%
Applied egg-rr99.2%
Taylor expanded in ew around inf 72.5%
if -2.6999999999999999e-132 < ew < 6.99999999999999962e-184Initial program 99.8%
fabs-sub99.8%
sub-neg99.8%
+-commutative99.8%
associate-*l*99.8%
distribute-rgt-neg-in99.8%
fma-define99.8%
Simplified99.8%
Taylor expanded in t around 0 61.4%
Taylor expanded in ew around 0 48.4%
mul-1-neg48.4%
associate-*l/48.4%
*-commutative48.4%
distribute-rgt-neg-in48.4%
distribute-frac-neg48.4%
Simplified48.4%
Taylor expanded in t around 0 48.4%
associate-*r/48.4%
associate-*r*48.4%
neg-mul-148.4%
associate-*l/48.4%
*-commutative48.4%
Simplified48.4%
Final simplification65.4%
(FPCore (eh ew t) :precision binary64 (fabs (* ew (cos t))))
double code(double eh, double ew, double t) {
return fabs((ew * cos(t)));
}
real(8) function code(eh, ew, t)
real(8), intent (in) :: eh
real(8), intent (in) :: ew
real(8), intent (in) :: t
code = abs((ew * cos(t)))
end function
public static double code(double eh, double ew, double t) {
return Math.abs((ew * Math.cos(t)));
}
def code(eh, ew, t): return math.fabs((ew * math.cos(t)))
function code(eh, ew, t) return abs(Float64(ew * cos(t))) end
function tmp = code(eh, ew, t) tmp = abs((ew * cos(t))); end
code[eh_, ew_, t_] := N[Abs[N[(ew * N[Cos[t], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\left|ew \cdot \cos t\right|
\end{array}
Initial program 99.8%
fabs-sub99.8%
sub-neg99.8%
+-commutative99.8%
associate-*l*99.8%
distribute-rgt-neg-in99.8%
fma-define99.8%
Simplified99.8%
add-sqr-sqrt21.8%
sqrt-unprod99.3%
sqr-neg99.3%
sqrt-unprod77.4%
add-sqr-sqrt99.2%
associate-*r/99.2%
add-log-exp99.1%
associate-*r/99.1%
cos-atan99.1%
Applied egg-rr99.1%
Taylor expanded in ew around inf 57.1%
(FPCore (eh ew t) :precision binary64 (fabs ew))
double code(double eh, double ew, double t) {
return fabs(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(ew)
end function
public static double code(double eh, double ew, double t) {
return Math.abs(ew);
}
def code(eh, ew, t): return math.fabs(ew)
function code(eh, ew, t) return abs(ew) end
function tmp = code(eh, ew, t) tmp = abs(ew); end
code[eh_, ew_, t_] := N[Abs[ew], $MachinePrecision]
\begin{array}{l}
\\
\left|ew\right|
\end{array}
Initial program 99.8%
fabs-sub99.8%
sub-neg99.8%
+-commutative99.8%
associate-*l*99.8%
distribute-rgt-neg-in99.8%
fma-define99.8%
Simplified99.8%
add-sqr-sqrt21.8%
sqrt-unprod99.3%
sqr-neg99.3%
sqrt-unprod77.4%
add-sqr-sqrt99.2%
associate-*r/99.2%
add-log-exp99.1%
associate-*r/99.1%
cos-atan99.1%
Applied egg-rr99.1%
Taylor expanded in t around 0 40.7%
(FPCore (eh ew t) :precision binary64 ew)
double code(double eh, double ew, double t) {
return ew;
}
real(8) function code(eh, ew, t)
real(8), intent (in) :: eh
real(8), intent (in) :: ew
real(8), intent (in) :: t
code = ew
end function
public static double code(double eh, double ew, double t) {
return ew;
}
def code(eh, ew, t): return ew
function code(eh, ew, t) return ew end
function tmp = code(eh, ew, t) tmp = ew; end
code[eh_, ew_, t_] := ew
\begin{array}{l}
\\
ew
\end{array}
Initial program 99.8%
Applied egg-rr48.0%
Taylor expanded in t around 0 18.6%
*-un-lft-identity18.6%
unpow218.6%
add-sqr-sqrt19.6%
Applied egg-rr19.6%
Final simplification19.6%
herbie shell --seed 2024185
(FPCore (eh ew t)
:name "Example 2 from Robby"
:precision binary64
(fabs (- (* (* ew (cos t)) (cos (atan (/ (* (- eh) (tan t)) ew)))) (* (* eh (sin t)) (sin (atan (/ (* (- eh) (tan t)) ew)))))))