
(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 13 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 (fma ew (* (cos t_1) (- (cos t))) (* eh (* (sin t) (sin t_1)))))))
double code(double eh, double ew, double t) {
double t_1 = atan((eh * (tan(t) / -ew)));
return fabs(fma(ew, (cos(t_1) * -cos(t)), (eh * (sin(t) * sin(t_1)))));
}
function code(eh, ew, t) t_1 = atan(Float64(eh * Float64(tan(t) / Float64(-ew)))) return abs(fma(ew, Float64(cos(t_1) * Float64(-cos(t))), Float64(eh * Float64(sin(t) * sin(t_1))))) end
code[eh_, ew_, t_] := Block[{t$95$1 = N[ArcTan[N[(eh * N[(N[Tan[t], $MachinePrecision] / (-ew)), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, N[Abs[N[(ew * N[(N[Cos[t$95$1], $MachinePrecision] * (-N[Cos[t], $MachinePrecision])), $MachinePrecision] + N[(eh * N[(N[Sin[t], $MachinePrecision] * N[Sin[t$95$1], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \tan^{-1} \left(eh \cdot \frac{\tan t}{-ew}\right)\\
\left|\mathsf{fma}\left(ew, \cos t\_1 \cdot \left(-\cos t\right), eh \cdot \left(\sin t \cdot \sin t\_1\right)\right)\right|
\end{array}
\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%
Final simplification99.8%
(FPCore (eh ew t) :precision binary64 (fabs (- (/ (* ew (cos t)) (hypot 1.0 (* (tan t) (/ eh ew)))) (* eh (* (sin t) (sin (atan (* eh (/ (tan t) (- ew))))))))))
double code(double eh, double ew, double t) {
return fabs((((ew * cos(t)) / hypot(1.0, (tan(t) * (eh / ew)))) - (eh * (sin(t) * sin(atan((eh * (tan(t) / -ew))))))));
}
public static double code(double eh, double ew, double t) {
return Math.abs((((ew * Math.cos(t)) / Math.hypot(1.0, (Math.tan(t) * (eh / ew)))) - (eh * (Math.sin(t) * Math.sin(Math.atan((eh * (Math.tan(t) / -ew))))))));
}
def code(eh, ew, t): return math.fabs((((ew * math.cos(t)) / math.hypot(1.0, (math.tan(t) * (eh / ew)))) - (eh * (math.sin(t) * math.sin(math.atan((eh * (math.tan(t) / -ew))))))))
function code(eh, ew, t) return abs(Float64(Float64(Float64(ew * cos(t)) / hypot(1.0, Float64(tan(t) * Float64(eh / ew)))) - Float64(eh * Float64(sin(t) * sin(atan(Float64(eh * Float64(tan(t) / Float64(-ew))))))))) end
function tmp = code(eh, ew, t) tmp = abs((((ew * cos(t)) / hypot(1.0, (tan(t) * (eh / ew)))) - (eh * (sin(t) * sin(atan((eh * (tan(t) / -ew)))))))); end
code[eh_, ew_, t_] := N[Abs[N[(N[(N[(ew * N[Cos[t], $MachinePrecision]), $MachinePrecision] / N[Sqrt[1.0 ^ 2 + N[(N[Tan[t], $MachinePrecision] * N[(eh / ew), $MachinePrecision]), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision] - N[(eh * N[(N[Sin[t], $MachinePrecision] * N[Sin[N[ArcTan[N[(eh * N[(N[Tan[t], $MachinePrecision] / (-ew)), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\left|\frac{ew \cdot \cos t}{\mathsf{hypot}\left(1, \tan t \cdot \frac{eh}{ew}\right)} - eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(eh \cdot \frac{\tan t}{-ew}\right)\right)\right|
\end{array}
Initial program 99.8%
sub-neg99.8%
associate-*l*99.8%
distribute-rgt-neg-in99.8%
cancel-sign-sub99.8%
associate-/l*99.8%
Simplified99.8%
cos-atan99.8%
un-div-inv99.8%
hypot-1-def99.8%
add-sqr-sqrt47.2%
sqrt-unprod93.5%
sqr-neg93.5%
sqrt-unprod52.6%
add-sqr-sqrt99.8%
Applied egg-rr99.8%
associate-*r/99.8%
associate-*l/99.8%
*-commutative99.8%
Simplified99.8%
Final simplification99.8%
(FPCore (eh ew t) :precision binary64 (fabs (- (* ew (cos t)) (* (* eh (sin t)) (sin (atan (/ (* eh (tan t)) (- ew))))))))
double code(double eh, double ew, double t) {
return fabs(((ew * cos(t)) - ((eh * sin(t)) * sin(atan(((eh * tan(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 = abs(((ew * cos(t)) - ((eh * sin(t)) * sin(atan(((eh * tan(t)) / -ew))))))
end function
public static double code(double eh, double ew, double t) {
return Math.abs(((ew * Math.cos(t)) - ((eh * Math.sin(t)) * Math.sin(Math.atan(((eh * Math.tan(t)) / -ew))))));
}
def code(eh, ew, t): return math.fabs(((ew * math.cos(t)) - ((eh * math.sin(t)) * math.sin(math.atan(((eh * math.tan(t)) / -ew))))))
function code(eh, ew, t) return abs(Float64(Float64(ew * cos(t)) - Float64(Float64(eh * sin(t)) * sin(atan(Float64(Float64(eh * tan(t)) / Float64(-ew))))))) end
function tmp = code(eh, ew, t) tmp = abs(((ew * cos(t)) - ((eh * sin(t)) * sin(atan(((eh * tan(t)) / -ew)))))); end
code[eh_, ew_, t_] := N[Abs[N[(N[(ew * N[Cos[t], $MachinePrecision]), $MachinePrecision] - N[(N[(eh * N[Sin[t], $MachinePrecision]), $MachinePrecision] * N[Sin[N[ArcTan[N[(N[(eh * N[Tan[t], $MachinePrecision]), $MachinePrecision] / (-ew)), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\left|ew \cdot \cos t - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{eh \cdot \tan t}{-ew}\right)\right|
\end{array}
Initial program 99.8%
sub-neg99.8%
associate-*l*99.8%
distribute-rgt-neg-in99.8%
cancel-sign-sub99.8%
associate-/l*99.8%
Simplified99.8%
cos-atan99.8%
un-div-inv99.8%
hypot-1-def99.8%
add-sqr-sqrt47.2%
sqrt-unprod93.5%
sqr-neg93.5%
sqrt-unprod52.6%
add-sqr-sqrt99.8%
Applied egg-rr99.8%
associate-*r/99.8%
associate-*l/99.8%
*-commutative99.8%
Simplified99.8%
Taylor expanded in eh around 0 98.0%
mul-1-neg98.0%
+-commutative98.0%
unsub-neg98.0%
associate-*r*98.0%
mul-1-neg98.0%
distribute-frac-neg298.0%
Simplified98.0%
(FPCore (eh ew t)
:precision binary64
(let* ((t_1 (* ew (cos t))) (t_2 (fabs t_1)))
(if (<= ew -2e-94)
t_2
(if (<= ew 2.1e-215)
(fabs (* (* eh (sin t)) (sin (atan (* eh (/ (tan t) (- ew)))))))
(if (<= ew 1.55e+63)
(+ 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 <= -2e-94) {
tmp = t_2;
} else if (ew <= 2.1e-215) {
tmp = fabs(((eh * sin(t)) * sin(atan((eh * (tan(t) / -ew))))));
} else if (ew <= 1.55e+63) {
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 <= (-2d-94)) then
tmp = t_2
else if (ew <= 2.1d-215) then
tmp = abs(((eh * sin(t)) * sin(atan((eh * (tan(t) / -ew))))))
else if (ew <= 1.55d+63) 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 <= -2e-94) {
tmp = t_2;
} else if (ew <= 2.1e-215) {
tmp = Math.abs(((eh * Math.sin(t)) * Math.sin(Math.atan((eh * (Math.tan(t) / -ew))))));
} else if (ew <= 1.55e+63) {
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 <= -2e-94: tmp = t_2 elif ew <= 2.1e-215: tmp = math.fabs(((eh * math.sin(t)) * math.sin(math.atan((eh * (math.tan(t) / -ew)))))) elif ew <= 1.55e+63: 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 <= -2e-94) tmp = t_2; elseif (ew <= 2.1e-215) tmp = abs(Float64(Float64(eh * sin(t)) * sin(atan(Float64(eh * Float64(tan(t) / Float64(-ew))))))); elseif (ew <= 1.55e+63) 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 <= -2e-94) tmp = t_2; elseif (ew <= 2.1e-215) tmp = abs(((eh * sin(t)) * sin(atan((eh * (tan(t) / -ew)))))); elseif (ew <= 1.55e+63) 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, -2e-94], t$95$2, If[LessEqual[ew, 2.1e-215], N[Abs[N[(N[(eh * N[Sin[t], $MachinePrecision]), $MachinePrecision] * N[Sin[N[ArcTan[N[(eh * N[(N[Tan[t], $MachinePrecision] / (-ew)), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[ew, 1.55e+63], 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 -2 \cdot 10^{-94}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;ew \leq 2.1 \cdot 10^{-215}:\\
\;\;\;\;\left|\left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(eh \cdot \frac{\tan t}{-ew}\right)\right|\\
\mathbf{elif}\;ew \leq 1.55 \cdot 10^{+63}:\\
\;\;\;\;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.9999999999999999e-94 or 1.55e63 < ew Initial program 99.8%
sub-neg99.8%
associate-*l*99.8%
distribute-rgt-neg-in99.8%
cancel-sign-sub99.8%
associate-/l*99.8%
Simplified99.8%
cos-atan99.8%
un-div-inv99.8%
hypot-1-def99.8%
add-sqr-sqrt45.8%
sqrt-unprod90.1%
sqr-neg90.1%
sqrt-unprod54.0%
add-sqr-sqrt99.8%
Applied egg-rr99.8%
associate-*r/99.8%
associate-*l/99.8%
*-commutative99.8%
Simplified99.8%
Taylor expanded in ew around inf 87.6%
if -1.9999999999999999e-94 < ew < 2.1e-215Initial program 99.7%
fabs-sub99.7%
sub-neg99.7%
+-commutative99.7%
associate-*l*99.7%
distribute-rgt-neg-in99.7%
fma-define99.7%
Simplified99.7%
Taylor expanded in ew around 0 80.1%
associate-*r*80.1%
mul-1-neg80.1%
distribute-frac-neg280.1%
associate-/l*80.1%
Simplified80.1%
if 2.1e-215 < ew < 1.55e63Initial program 99.7%
sub-neg99.7%
associate-*l*99.7%
distribute-rgt-neg-in99.7%
cancel-sign-sub99.7%
associate-/l*99.7%
Simplified99.7%
fabs-sub99.7%
sub-neg99.7%
associate-*l*99.7%
*-commutative99.7%
distribute-rgt-neg-out99.7%
distribute-rgt-neg-out99.7%
Applied egg-rr83.5%
Taylor expanded in eh around 0 81.3%
Final simplification84.3%
(FPCore (eh ew t) :precision binary64 (if (or (<= ew -4.5e-98) (not (<= ew 3e-60))) (fabs (* ew (cos t))) (fabs (* (* eh (sin t)) (sin (atan (* eh (/ (tan t) (- ew)))))))))
double code(double eh, double ew, double t) {
double tmp;
if ((ew <= -4.5e-98) || !(ew <= 3e-60)) {
tmp = fabs((ew * cos(t)));
} else {
tmp = fabs(((eh * sin(t)) * sin(atan((eh * (tan(t) / -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 <= (-4.5d-98)) .or. (.not. (ew <= 3d-60))) then
tmp = abs((ew * cos(t)))
else
tmp = abs(((eh * sin(t)) * sin(atan((eh * (tan(t) / -ew))))))
end if
code = tmp
end function
public static double code(double eh, double ew, double t) {
double tmp;
if ((ew <= -4.5e-98) || !(ew <= 3e-60)) {
tmp = Math.abs((ew * Math.cos(t)));
} else {
tmp = Math.abs(((eh * Math.sin(t)) * Math.sin(Math.atan((eh * (Math.tan(t) / -ew))))));
}
return tmp;
}
def code(eh, ew, t): tmp = 0 if (ew <= -4.5e-98) or not (ew <= 3e-60): tmp = math.fabs((ew * math.cos(t))) else: tmp = math.fabs(((eh * math.sin(t)) * math.sin(math.atan((eh * (math.tan(t) / -ew)))))) return tmp
function code(eh, ew, t) tmp = 0.0 if ((ew <= -4.5e-98) || !(ew <= 3e-60)) tmp = abs(Float64(ew * cos(t))); else tmp = abs(Float64(Float64(eh * sin(t)) * sin(atan(Float64(eh * Float64(tan(t) / Float64(-ew))))))); end return tmp end
function tmp_2 = code(eh, ew, t) tmp = 0.0; if ((ew <= -4.5e-98) || ~((ew <= 3e-60))) tmp = abs((ew * cos(t))); else tmp = abs(((eh * sin(t)) * sin(atan((eh * (tan(t) / -ew)))))); end tmp_2 = tmp; end
code[eh_, ew_, t_] := If[Or[LessEqual[ew, -4.5e-98], N[Not[LessEqual[ew, 3e-60]], $MachinePrecision]], N[Abs[N[(ew * N[Cos[t], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Abs[N[(N[(eh * N[Sin[t], $MachinePrecision]), $MachinePrecision] * N[Sin[N[ArcTan[N[(eh * N[(N[Tan[t], $MachinePrecision] / (-ew)), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;ew \leq -4.5 \cdot 10^{-98} \lor \neg \left(ew \leq 3 \cdot 10^{-60}\right):\\
\;\;\;\;\left|ew \cdot \cos t\right|\\
\mathbf{else}:\\
\;\;\;\;\left|\left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(eh \cdot \frac{\tan t}{-ew}\right)\right|\\
\end{array}
\end{array}
if ew < -4.49999999999999997e-98 or 3.00000000000000019e-60 < ew Initial program 99.8%
sub-neg99.8%
associate-*l*99.8%
distribute-rgt-neg-in99.8%
cancel-sign-sub99.8%
associate-/l*99.8%
Simplified99.8%
cos-atan99.8%
un-div-inv99.8%
hypot-1-def99.8%
add-sqr-sqrt46.2%
sqrt-unprod91.2%
sqr-neg91.2%
sqrt-unprod53.6%
add-sqr-sqrt99.8%
Applied egg-rr99.8%
associate-*r/99.8%
associate-*l/99.8%
*-commutative99.8%
Simplified99.8%
Taylor expanded in ew around inf 84.8%
if -4.49999999999999997e-98 < ew < 3.00000000000000019e-60Initial program 99.7%
fabs-sub99.7%
sub-neg99.7%
+-commutative99.7%
associate-*l*99.7%
distribute-rgt-neg-in99.7%
fma-define99.7%
Simplified99.7%
Taylor expanded in ew around 0 74.2%
associate-*r*74.2%
mul-1-neg74.2%
distribute-frac-neg274.2%
associate-/l*74.2%
Simplified74.2%
Final simplification81.0%
(FPCore (eh ew t)
:precision binary64
(let* ((t_1 (sin (atan (* eh (/ (tan t) ew))))) (t_2 (fabs (* ew (cos t)))))
(if (<= ew -3e-142)
t_2
(if (<= ew -5.2e-256)
(* eh (* t_1 (- (sin t))))
(if (<= ew 3.7e-257)
(* (* eh (sin t)) t_1)
(if (<= ew 8.5e+38) (+ ew (* (* eh t) t_1)) t_2))))))
double code(double eh, double ew, double t) {
double t_1 = sin(atan((eh * (tan(t) / ew))));
double t_2 = fabs((ew * cos(t)));
double tmp;
if (ew <= -3e-142) {
tmp = t_2;
} else if (ew <= -5.2e-256) {
tmp = eh * (t_1 * -sin(t));
} else if (ew <= 3.7e-257) {
tmp = (eh * sin(t)) * t_1;
} else if (ew <= 8.5e+38) {
tmp = ew + ((eh * t) * t_1);
} 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 = sin(atan((eh * (tan(t) / ew))))
t_2 = abs((ew * cos(t)))
if (ew <= (-3d-142)) then
tmp = t_2
else if (ew <= (-5.2d-256)) then
tmp = eh * (t_1 * -sin(t))
else if (ew <= 3.7d-257) then
tmp = (eh * sin(t)) * t_1
else if (ew <= 8.5d+38) then
tmp = ew + ((eh * t) * t_1)
else
tmp = t_2
end if
code = tmp
end function
public static double code(double eh, double ew, double t) {
double t_1 = Math.sin(Math.atan((eh * (Math.tan(t) / ew))));
double t_2 = Math.abs((ew * Math.cos(t)));
double tmp;
if (ew <= -3e-142) {
tmp = t_2;
} else if (ew <= -5.2e-256) {
tmp = eh * (t_1 * -Math.sin(t));
} else if (ew <= 3.7e-257) {
tmp = (eh * Math.sin(t)) * t_1;
} else if (ew <= 8.5e+38) {
tmp = ew + ((eh * t) * t_1);
} else {
tmp = t_2;
}
return tmp;
}
def code(eh, ew, t): t_1 = math.sin(math.atan((eh * (math.tan(t) / ew)))) t_2 = math.fabs((ew * math.cos(t))) tmp = 0 if ew <= -3e-142: tmp = t_2 elif ew <= -5.2e-256: tmp = eh * (t_1 * -math.sin(t)) elif ew <= 3.7e-257: tmp = (eh * math.sin(t)) * t_1 elif ew <= 8.5e+38: tmp = ew + ((eh * t) * t_1) else: tmp = t_2 return tmp
function code(eh, ew, t) t_1 = sin(atan(Float64(eh * Float64(tan(t) / ew)))) t_2 = abs(Float64(ew * cos(t))) tmp = 0.0 if (ew <= -3e-142) tmp = t_2; elseif (ew <= -5.2e-256) tmp = Float64(eh * Float64(t_1 * Float64(-sin(t)))); elseif (ew <= 3.7e-257) tmp = Float64(Float64(eh * sin(t)) * t_1); elseif (ew <= 8.5e+38) tmp = Float64(ew + Float64(Float64(eh * t) * t_1)); else tmp = t_2; end return tmp end
function tmp_2 = code(eh, ew, t) t_1 = sin(atan((eh * (tan(t) / ew)))); t_2 = abs((ew * cos(t))); tmp = 0.0; if (ew <= -3e-142) tmp = t_2; elseif (ew <= -5.2e-256) tmp = eh * (t_1 * -sin(t)); elseif (ew <= 3.7e-257) tmp = (eh * sin(t)) * t_1; elseif (ew <= 8.5e+38) tmp = ew + ((eh * t) * t_1); else tmp = t_2; end tmp_2 = tmp; end
code[eh_, ew_, t_] := Block[{t$95$1 = N[Sin[N[ArcTan[N[(eh * N[(N[Tan[t], $MachinePrecision] / ew), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Abs[N[(ew * N[Cos[t], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[ew, -3e-142], t$95$2, If[LessEqual[ew, -5.2e-256], N[(eh * N[(t$95$1 * (-N[Sin[t], $MachinePrecision])), $MachinePrecision]), $MachinePrecision], If[LessEqual[ew, 3.7e-257], N[(N[(eh * N[Sin[t], $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision], If[LessEqual[ew, 8.5e+38], N[(ew + N[(N[(eh * t), $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision], t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \sin \tan^{-1} \left(eh \cdot \frac{\tan t}{ew}\right)\\
t_2 := \left|ew \cdot \cos t\right|\\
\mathbf{if}\;ew \leq -3 \cdot 10^{-142}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;ew \leq -5.2 \cdot 10^{-256}:\\
\;\;\;\;eh \cdot \left(t\_1 \cdot \left(-\sin t\right)\right)\\
\mathbf{elif}\;ew \leq 3.7 \cdot 10^{-257}:\\
\;\;\;\;\left(eh \cdot \sin t\right) \cdot t\_1\\
\mathbf{elif}\;ew \leq 8.5 \cdot 10^{+38}:\\
\;\;\;\;ew + \left(eh \cdot t\right) \cdot t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if ew < -3.0000000000000001e-142 or 8.4999999999999997e38 < ew Initial program 99.8%
sub-neg99.8%
associate-*l*99.8%
distribute-rgt-neg-in99.8%
cancel-sign-sub99.8%
associate-/l*99.8%
Simplified99.8%
cos-atan99.8%
un-div-inv99.8%
hypot-1-def99.8%
add-sqr-sqrt46.9%
sqrt-unprod90.5%
sqr-neg90.5%
sqrt-unprod52.9%
add-sqr-sqrt99.8%
Applied egg-rr99.8%
associate-*r/99.8%
associate-*l/99.8%
*-commutative99.8%
Simplified99.8%
Taylor expanded in ew around inf 84.1%
if -3.0000000000000001e-142 < ew < -5.2000000000000002e-256Initial program 99.7%
sub-neg99.7%
associate-*l*99.7%
distribute-rgt-neg-in99.7%
cancel-sign-sub99.7%
associate-/l*99.7%
Simplified99.7%
Applied egg-rr78.4%
neg-sub078.4%
associate-*r/78.4%
associate-*l/78.4%
*-commutative78.4%
associate-*r/78.4%
associate-*r/78.4%
associate-*l/78.4%
*-commutative78.4%
Simplified78.4%
Taylor expanded in eh around inf 61.3%
mul-1-neg61.3%
associate-*r*61.3%
*-commutative61.3%
associate-*r/61.3%
associate-*r*61.3%
distribute-rgt-neg-in61.3%
distribute-rgt-neg-in61.3%
associate-*r/61.3%
*-commutative61.3%
associate-/l*61.3%
Simplified61.3%
if -5.2000000000000002e-256 < ew < 3.69999999999999984e-257Initial program 99.7%
sub-neg99.7%
associate-*l*99.7%
distribute-rgt-neg-in99.7%
cancel-sign-sub99.7%
associate-/l*99.7%
Simplified99.7%
fabs-sub99.7%
sub-neg99.7%
associate-*l*99.7%
*-commutative99.7%
distribute-rgt-neg-out99.7%
distribute-rgt-neg-out99.7%
Applied egg-rr75.3%
Taylor expanded in ew around 0 62.3%
associate-*r*62.3%
associate-/l*62.3%
Simplified62.3%
if 3.69999999999999984e-257 < ew < 8.4999999999999997e38Initial program 99.8%
sub-neg99.8%
associate-*l*99.8%
distribute-rgt-neg-in99.8%
cancel-sign-sub99.8%
associate-/l*99.8%
Simplified99.8%
fabs-sub99.8%
sub-neg99.8%
associate-*l*99.8%
*-commutative99.8%
distribute-rgt-neg-out99.8%
distribute-rgt-neg-out99.8%
Applied egg-rr76.3%
Taylor expanded in t around 0 67.1%
associate-*r*67.1%
*-commutative67.1%
associate-/l*67.1%
Simplified67.1%
Final simplification76.1%
(FPCore (eh ew t) :precision binary64 (if (or (<= t -9e-8) (not (<= t 0.082))) (fabs (* ew (cos t))) (fabs (- (* (sin (atan (/ (* eh (tan t)) (- ew)))) (* eh t)) ew))))
double code(double eh, double ew, double t) {
double tmp;
if ((t <= -9e-8) || !(t <= 0.082)) {
tmp = fabs((ew * cos(t)));
} else {
tmp = fabs(((sin(atan(((eh * tan(t)) / -ew))) * (eh * t)) - 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 ((t <= (-9d-8)) .or. (.not. (t <= 0.082d0))) then
tmp = abs((ew * cos(t)))
else
tmp = abs(((sin(atan(((eh * tan(t)) / -ew))) * (eh * t)) - ew))
end if
code = tmp
end function
public static double code(double eh, double ew, double t) {
double tmp;
if ((t <= -9e-8) || !(t <= 0.082)) {
tmp = Math.abs((ew * Math.cos(t)));
} else {
tmp = Math.abs(((Math.sin(Math.atan(((eh * Math.tan(t)) / -ew))) * (eh * t)) - ew));
}
return tmp;
}
def code(eh, ew, t): tmp = 0 if (t <= -9e-8) or not (t <= 0.082): tmp = math.fabs((ew * math.cos(t))) else: tmp = math.fabs(((math.sin(math.atan(((eh * math.tan(t)) / -ew))) * (eh * t)) - ew)) return tmp
function code(eh, ew, t) tmp = 0.0 if ((t <= -9e-8) || !(t <= 0.082)) tmp = abs(Float64(ew * cos(t))); else tmp = abs(Float64(Float64(sin(atan(Float64(Float64(eh * tan(t)) / Float64(-ew)))) * Float64(eh * t)) - ew)); end return tmp end
function tmp_2 = code(eh, ew, t) tmp = 0.0; if ((t <= -9e-8) || ~((t <= 0.082))) tmp = abs((ew * cos(t))); else tmp = abs(((sin(atan(((eh * tan(t)) / -ew))) * (eh * t)) - ew)); end tmp_2 = tmp; end
code[eh_, ew_, t_] := If[Or[LessEqual[t, -9e-8], N[Not[LessEqual[t, 0.082]], $MachinePrecision]], N[Abs[N[(ew * N[Cos[t], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Abs[N[(N[(N[Sin[N[ArcTan[N[(N[(eh * N[Tan[t], $MachinePrecision]), $MachinePrecision] / (-ew)), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * N[(eh * t), $MachinePrecision]), $MachinePrecision] - ew), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -9 \cdot 10^{-8} \lor \neg \left(t \leq 0.082\right):\\
\;\;\;\;\left|ew \cdot \cos t\right|\\
\mathbf{else}:\\
\;\;\;\;\left|\sin \tan^{-1} \left(\frac{eh \cdot \tan t}{-ew}\right) \cdot \left(eh \cdot t\right) - ew\right|\\
\end{array}
\end{array}
if t < -8.99999999999999986e-8 or 0.0820000000000000034 < t Initial program 99.6%
sub-neg99.6%
associate-*l*99.6%
distribute-rgt-neg-in99.6%
cancel-sign-sub99.6%
associate-/l*99.6%
Simplified99.6%
cos-atan99.6%
un-div-inv99.6%
hypot-1-def99.6%
add-sqr-sqrt45.7%
sqrt-unprod96.2%
sqr-neg96.2%
sqrt-unprod53.9%
add-sqr-sqrt99.6%
Applied egg-rr99.6%
associate-*r/99.6%
associate-*l/99.6%
*-commutative99.6%
Simplified99.6%
Taylor expanded in ew around inf 57.2%
if -8.99999999999999986e-8 < t < 0.0820000000000000034Initial program 100.0%
sub-neg100.0%
associate-*l*100.0%
distribute-rgt-neg-in100.0%
cancel-sign-sub100.0%
associate-/l*100.0%
Simplified100.0%
cos-atan100.0%
un-div-inv100.0%
hypot-1-def100.0%
add-sqr-sqrt48.8%
sqrt-unprod90.6%
sqr-neg90.6%
sqrt-unprod51.2%
add-sqr-sqrt100.0%
Applied egg-rr100.0%
associate-*r/100.0%
associate-*l/100.0%
*-commutative100.0%
Simplified100.0%
Taylor expanded in t around 0 97.8%
mul-1-neg97.8%
unsub-neg97.8%
associate-*r*97.8%
*-commutative97.8%
mul-1-neg97.8%
distribute-frac-neg297.8%
Simplified97.8%
Final simplification76.7%
(FPCore (eh ew t)
:precision binary64
(let* ((t_1 (sin (atan (* eh (/ (tan t) ew))))) (t_2 (fabs (* ew (cos t)))))
(if (<= ew -4.15e-222)
t_2
(if (<= ew 3.15e-257)
(* (* eh (sin t)) t_1)
(if (<= ew 8.5e+38) (+ ew (* (* eh t) t_1)) t_2)))))
double code(double eh, double ew, double t) {
double t_1 = sin(atan((eh * (tan(t) / ew))));
double t_2 = fabs((ew * cos(t)));
double tmp;
if (ew <= -4.15e-222) {
tmp = t_2;
} else if (ew <= 3.15e-257) {
tmp = (eh * sin(t)) * t_1;
} else if (ew <= 8.5e+38) {
tmp = ew + ((eh * t) * t_1);
} 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 = sin(atan((eh * (tan(t) / ew))))
t_2 = abs((ew * cos(t)))
if (ew <= (-4.15d-222)) then
tmp = t_2
else if (ew <= 3.15d-257) then
tmp = (eh * sin(t)) * t_1
else if (ew <= 8.5d+38) then
tmp = ew + ((eh * t) * t_1)
else
tmp = t_2
end if
code = tmp
end function
public static double code(double eh, double ew, double t) {
double t_1 = Math.sin(Math.atan((eh * (Math.tan(t) / ew))));
double t_2 = Math.abs((ew * Math.cos(t)));
double tmp;
if (ew <= -4.15e-222) {
tmp = t_2;
} else if (ew <= 3.15e-257) {
tmp = (eh * Math.sin(t)) * t_1;
} else if (ew <= 8.5e+38) {
tmp = ew + ((eh * t) * t_1);
} else {
tmp = t_2;
}
return tmp;
}
def code(eh, ew, t): t_1 = math.sin(math.atan((eh * (math.tan(t) / ew)))) t_2 = math.fabs((ew * math.cos(t))) tmp = 0 if ew <= -4.15e-222: tmp = t_2 elif ew <= 3.15e-257: tmp = (eh * math.sin(t)) * t_1 elif ew <= 8.5e+38: tmp = ew + ((eh * t) * t_1) else: tmp = t_2 return tmp
function code(eh, ew, t) t_1 = sin(atan(Float64(eh * Float64(tan(t) / ew)))) t_2 = abs(Float64(ew * cos(t))) tmp = 0.0 if (ew <= -4.15e-222) tmp = t_2; elseif (ew <= 3.15e-257) tmp = Float64(Float64(eh * sin(t)) * t_1); elseif (ew <= 8.5e+38) tmp = Float64(ew + Float64(Float64(eh * t) * t_1)); else tmp = t_2; end return tmp end
function tmp_2 = code(eh, ew, t) t_1 = sin(atan((eh * (tan(t) / ew)))); t_2 = abs((ew * cos(t))); tmp = 0.0; if (ew <= -4.15e-222) tmp = t_2; elseif (ew <= 3.15e-257) tmp = (eh * sin(t)) * t_1; elseif (ew <= 8.5e+38) tmp = ew + ((eh * t) * t_1); else tmp = t_2; end tmp_2 = tmp; end
code[eh_, ew_, t_] := Block[{t$95$1 = N[Sin[N[ArcTan[N[(eh * N[(N[Tan[t], $MachinePrecision] / ew), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Abs[N[(ew * N[Cos[t], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[ew, -4.15e-222], t$95$2, If[LessEqual[ew, 3.15e-257], N[(N[(eh * N[Sin[t], $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision], If[LessEqual[ew, 8.5e+38], N[(ew + N[(N[(eh * t), $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision], t$95$2]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \sin \tan^{-1} \left(eh \cdot \frac{\tan t}{ew}\right)\\
t_2 := \left|ew \cdot \cos t\right|\\
\mathbf{if}\;ew \leq -4.15 \cdot 10^{-222}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;ew \leq 3.15 \cdot 10^{-257}:\\
\;\;\;\;\left(eh \cdot \sin t\right) \cdot t\_1\\
\mathbf{elif}\;ew \leq 8.5 \cdot 10^{+38}:\\
\;\;\;\;ew + \left(eh \cdot t\right) \cdot t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if ew < -4.15000000000000005e-222 or 8.4999999999999997e38 < ew Initial program 99.8%
sub-neg99.8%
associate-*l*99.8%
distribute-rgt-neg-in99.8%
cancel-sign-sub99.8%
associate-/l*99.8%
Simplified99.8%
cos-atan99.8%
un-div-inv99.8%
hypot-1-def99.8%
add-sqr-sqrt46.3%
sqrt-unprod91.3%
sqr-neg91.3%
sqrt-unprod53.5%
add-sqr-sqrt99.8%
Applied egg-rr99.8%
associate-*r/99.8%
associate-*l/99.8%
*-commutative99.8%
Simplified99.8%
Taylor expanded in ew around inf 78.3%
if -4.15000000000000005e-222 < ew < 3.14999999999999997e-257Initial program 99.6%
sub-neg99.6%
associate-*l*99.6%
distribute-rgt-neg-in99.6%
cancel-sign-sub99.6%
associate-/l*99.6%
Simplified99.6%
fabs-sub99.6%
sub-neg99.6%
associate-*l*99.6%
*-commutative99.6%
distribute-rgt-neg-out99.6%
distribute-rgt-neg-out99.6%
Applied egg-rr68.0%
Taylor expanded in ew around 0 57.4%
associate-*r*57.4%
associate-/l*57.4%
Simplified57.4%
if 3.14999999999999997e-257 < ew < 8.4999999999999997e38Initial program 99.8%
sub-neg99.8%
associate-*l*99.8%
distribute-rgt-neg-in99.8%
cancel-sign-sub99.8%
associate-/l*99.8%
Simplified99.8%
fabs-sub99.8%
sub-neg99.8%
associate-*l*99.8%
*-commutative99.8%
distribute-rgt-neg-out99.8%
distribute-rgt-neg-out99.8%
Applied egg-rr76.3%
Taylor expanded in t around 0 67.1%
associate-*r*67.1%
*-commutative67.1%
associate-/l*67.1%
Simplified67.1%
Final simplification73.2%
(FPCore (eh ew t)
:precision binary64
(let* ((t_1 (fabs (* ew (cos t)))))
(if (<= ew -6e-142)
t_1
(if (<= ew -5e-310)
(- (- ew) (* eh (* t (sin (atan (* eh (/ t ew)))))))
(if (<= ew 9e+38)
(+ 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 <= -6e-142) {
tmp = t_1;
} else if (ew <= -5e-310) {
tmp = -ew - (eh * (t * sin(atan((eh * (t / ew))))));
} else if (ew <= 9e+38) {
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 <= (-6d-142)) then
tmp = t_1
else if (ew <= (-5d-310)) then
tmp = -ew - (eh * (t * sin(atan((eh * (t / ew))))))
else if (ew <= 9d+38) 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 <= -6e-142) {
tmp = t_1;
} else if (ew <= -5e-310) {
tmp = -ew - (eh * (t * Math.sin(Math.atan((eh * (t / ew))))));
} else if (ew <= 9e+38) {
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 <= -6e-142: tmp = t_1 elif ew <= -5e-310: tmp = -ew - (eh * (t * math.sin(math.atan((eh * (t / ew)))))) elif ew <= 9e+38: 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 <= -6e-142) tmp = t_1; elseif (ew <= -5e-310) tmp = Float64(Float64(-ew) - Float64(eh * Float64(t * sin(atan(Float64(eh * Float64(t / ew))))))); elseif (ew <= 9e+38) tmp = Float64(ew + Float64(Float64(eh * t) * sin(atan(Float64(eh * Float64(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 <= -6e-142) tmp = t_1; elseif (ew <= -5e-310) tmp = -ew - (eh * (t * sin(atan((eh * (t / ew)))))); elseif (ew <= 9e+38) 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, -6e-142], t$95$1, If[LessEqual[ew, -5e-310], N[((-ew) - N[(eh * N[(t * N[Sin[N[ArcTan[N[(eh * N[(t / ew), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[ew, 9e+38], N[(ew + N[(N[(eh * t), $MachinePrecision] * N[Sin[N[ArcTan[N[(eh * N[(N[Tan[t], $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 -6 \cdot 10^{-142}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;ew \leq -5 \cdot 10^{-310}:\\
\;\;\;\;\left(-ew\right) - eh \cdot \left(t \cdot \sin \tan^{-1} \left(eh \cdot \frac{t}{ew}\right)\right)\\
\mathbf{elif}\;ew \leq 9 \cdot 10^{+38}:\\
\;\;\;\;ew + \left(eh \cdot t\right) \cdot \sin \tan^{-1} \left(eh \cdot \frac{\tan t}{ew}\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if ew < -6.0000000000000002e-142 or 8.99999999999999961e38 < ew Initial program 99.8%
sub-neg99.8%
associate-*l*99.8%
distribute-rgt-neg-in99.8%
cancel-sign-sub99.8%
associate-/l*99.8%
Simplified99.8%
cos-atan99.8%
un-div-inv99.8%
hypot-1-def99.8%
add-sqr-sqrt46.9%
sqrt-unprod90.5%
sqr-neg90.5%
sqrt-unprod52.9%
add-sqr-sqrt99.8%
Applied egg-rr99.8%
associate-*r/99.8%
associate-*l/99.8%
*-commutative99.8%
Simplified99.8%
Taylor expanded in ew around inf 84.1%
if -6.0000000000000002e-142 < ew < -4.999999999999985e-310Initial program 99.6%
sub-neg99.6%
associate-*l*99.7%
distribute-rgt-neg-in99.7%
cancel-sign-sub99.7%
associate-/l*99.7%
Simplified99.7%
Applied egg-rr66.1%
neg-sub066.1%
associate-*r/66.1%
associate-*l/66.1%
*-commutative66.1%
associate-*r/66.1%
associate-*r/66.1%
associate-*l/66.1%
*-commutative66.1%
Simplified66.1%
Taylor expanded in t around 0 30.9%
associate-*r*30.9%
neg-mul-130.9%
associate-/l*30.9%
Simplified30.9%
Taylor expanded in t around 0 32.4%
if -4.999999999999985e-310 < ew < 8.99999999999999961e38Initial program 99.8%
sub-neg99.8%
associate-*l*99.8%
distribute-rgt-neg-in99.8%
cancel-sign-sub99.8%
associate-/l*99.8%
Simplified99.8%
fabs-sub99.8%
sub-neg99.8%
associate-*l*99.8%
*-commutative99.8%
distribute-rgt-neg-out99.8%
distribute-rgt-neg-out99.8%
Applied egg-rr78.9%
Taylor expanded in t around 0 64.0%
associate-*r*64.0%
*-commutative64.0%
associate-/l*64.0%
Simplified64.0%
Final simplification71.5%
(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%
sub-neg99.8%
associate-*l*99.8%
distribute-rgt-neg-in99.8%
cancel-sign-sub99.8%
associate-/l*99.8%
Simplified99.8%
cos-atan99.8%
un-div-inv99.8%
hypot-1-def99.8%
add-sqr-sqrt47.2%
sqrt-unprod93.5%
sqr-neg93.5%
sqrt-unprod52.6%
add-sqr-sqrt99.8%
Applied egg-rr99.8%
associate-*r/99.8%
associate-*l/99.8%
*-commutative99.8%
Simplified99.8%
Taylor expanded in ew around inf 64.8%
(FPCore (eh ew t) :precision binary64 (if (or (<= t -0.00028) (not (<= t 1.1e+83))) (* (cos t) (- ew)) (fabs ew)))
double code(double eh, double ew, double t) {
double tmp;
if ((t <= -0.00028) || !(t <= 1.1e+83)) {
tmp = cos(t) * -ew;
} else {
tmp = fabs(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 ((t <= (-0.00028d0)) .or. (.not. (t <= 1.1d+83))) then
tmp = cos(t) * -ew
else
tmp = abs(ew)
end if
code = tmp
end function
public static double code(double eh, double ew, double t) {
double tmp;
if ((t <= -0.00028) || !(t <= 1.1e+83)) {
tmp = Math.cos(t) * -ew;
} else {
tmp = Math.abs(ew);
}
return tmp;
}
def code(eh, ew, t): tmp = 0 if (t <= -0.00028) or not (t <= 1.1e+83): tmp = math.cos(t) * -ew else: tmp = math.fabs(ew) return tmp
function code(eh, ew, t) tmp = 0.0 if ((t <= -0.00028) || !(t <= 1.1e+83)) tmp = Float64(cos(t) * Float64(-ew)); else tmp = abs(ew); end return tmp end
function tmp_2 = code(eh, ew, t) tmp = 0.0; if ((t <= -0.00028) || ~((t <= 1.1e+83))) tmp = cos(t) * -ew; else tmp = abs(ew); end tmp_2 = tmp; end
code[eh_, ew_, t_] := If[Or[LessEqual[t, -0.00028], N[Not[LessEqual[t, 1.1e+83]], $MachinePrecision]], N[(N[Cos[t], $MachinePrecision] * (-ew)), $MachinePrecision], N[Abs[ew], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -0.00028 \lor \neg \left(t \leq 1.1 \cdot 10^{+83}\right):\\
\;\;\;\;\cos t \cdot \left(-ew\right)\\
\mathbf{else}:\\
\;\;\;\;\left|ew\right|\\
\end{array}
\end{array}
if t < -2.7999999999999998e-4 or 1.09999999999999999e83 < t Initial program 99.6%
sub-neg99.6%
associate-*l*99.6%
distribute-rgt-neg-in99.6%
cancel-sign-sub99.6%
associate-/l*99.6%
Simplified99.6%
Applied egg-rr47.9%
neg-sub047.9%
associate-*r/47.9%
associate-*l/47.9%
*-commutative47.9%
associate-*r/47.9%
associate-*r/47.9%
associate-*l/47.9%
*-commutative47.9%
Simplified47.9%
Taylor expanded in eh around 0 28.8%
associate-*r*28.8%
neg-mul-128.8%
Simplified28.8%
if -2.7999999999999998e-4 < t < 1.09999999999999999e83Initial program 99.9%
sub-neg99.9%
associate-*l*99.9%
distribute-rgt-neg-in99.9%
cancel-sign-sub99.9%
associate-/l*99.9%
Simplified99.9%
cos-atan99.9%
un-div-inv99.9%
hypot-1-def99.9%
add-sqr-sqrt49.2%
sqrt-unprod91.5%
sqr-neg91.5%
sqrt-unprod50.7%
add-sqr-sqrt99.9%
Applied egg-rr99.9%
associate-*r/99.9%
associate-*l/99.9%
*-commutative99.9%
Simplified99.9%
Taylor expanded in t around 0 66.9%
Final simplification49.3%
(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%
sub-neg99.8%
associate-*l*99.8%
distribute-rgt-neg-in99.8%
cancel-sign-sub99.8%
associate-/l*99.8%
Simplified99.8%
cos-atan99.8%
un-div-inv99.8%
hypot-1-def99.8%
add-sqr-sqrt47.2%
sqrt-unprod93.5%
sqr-neg93.5%
sqrt-unprod52.6%
add-sqr-sqrt99.8%
Applied egg-rr99.8%
associate-*r/99.8%
associate-*l/99.8%
*-commutative99.8%
Simplified99.8%
Taylor expanded in t around 0 42.8%
(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 Float64(-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%
sub-neg99.8%
associate-*l*99.8%
distribute-rgt-neg-in99.8%
cancel-sign-sub99.8%
associate-/l*99.8%
Simplified99.8%
Applied egg-rr46.0%
neg-sub046.0%
associate-*r/46.0%
associate-*l/46.0%
*-commutative46.0%
associate-*r/46.0%
associate-*r/46.0%
associate-*l/46.0%
*-commutative46.0%
Simplified46.0%
Taylor expanded in t around 0 21.9%
neg-mul-121.9%
Simplified21.9%
herbie shell --seed 2024180
(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)))))))