
(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 15 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(eh * Float64(-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{eh \cdot \left(-\tan t\right)}{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%
Final simplification99.8%
(FPCore (eh ew t) :precision binary64 (fabs (- (/ 1.0 (/ (hypot 1.0 (* (tan t) (/ eh ew))) (* ew (cos t)))) (* (* eh (sin t)) (sin (atan (/ (* eh (- (tan t))) ew)))))))
double code(double eh, double ew, double t) {
return fabs(((1.0 / (hypot(1.0, (tan(t) * (eh / ew))) / (ew * cos(t)))) - ((eh * sin(t)) * sin(atan(((eh * -tan(t)) / ew))))));
}
public static double code(double eh, double ew, double t) {
return Math.abs(((1.0 / (Math.hypot(1.0, (Math.tan(t) * (eh / ew))) / (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(((1.0 / (math.hypot(1.0, (math.tan(t) * (eh / ew))) / (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(1.0 / Float64(hypot(1.0, Float64(tan(t) * Float64(eh / ew))) / Float64(ew * cos(t)))) - Float64(Float64(eh * sin(t)) * sin(atan(Float64(Float64(eh * Float64(-tan(t))) / ew)))))) end
function tmp = code(eh, ew, t) tmp = abs(((1.0 / (hypot(1.0, (tan(t) * (eh / ew))) / (ew * cos(t)))) - ((eh * sin(t)) * sin(atan(((eh * -tan(t)) / ew)))))); end
code[eh_, ew_, t_] := N[Abs[N[(N[(1.0 / N[(N[Sqrt[1.0 ^ 2 + N[(N[Tan[t], $MachinePrecision] * N[(eh / ew), $MachinePrecision]), $MachinePrecision] ^ 2], $MachinePrecision] / N[(ew * N[Cos[t], $MachinePrecision]), $MachinePrecision]), $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|\frac{1}{\frac{\mathsf{hypot}\left(1, \tan t \cdot \frac{eh}{ew}\right)}{ew \cdot \cos t}} - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{eh \cdot \left(-\tan t\right)}{ew}\right)\right|
\end{array}
Initial program 99.8%
add-cbrt-cube58.0%
pow358.0%
Applied egg-rr59.8%
rem-cbrt-cube99.8%
clear-num99.7%
Applied egg-rr99.7%
Final simplification99.7%
(FPCore (eh ew t)
:precision binary64
(let* ((t_1 (* ew (cos t))))
(if (or (<= eh -2.7e-140) (not (<= eh 1.95e-138)))
(fabs
(* eh (+ (* (sin t) (sin (atan (/ (* eh (- (tan t))) ew)))) (/ t_1 eh))))
(fabs t_1))))
double code(double eh, double ew, double t) {
double t_1 = ew * cos(t);
double tmp;
if ((eh <= -2.7e-140) || !(eh <= 1.95e-138)) {
tmp = fabs((eh * ((sin(t) * sin(atan(((eh * -tan(t)) / ew)))) + (t_1 / eh))));
} else {
tmp = fabs(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 = ew * cos(t)
if ((eh <= (-2.7d-140)) .or. (.not. (eh <= 1.95d-138))) then
tmp = abs((eh * ((sin(t) * sin(atan(((eh * -tan(t)) / ew)))) + (t_1 / eh))))
else
tmp = abs(t_1)
end if
code = tmp
end function
public static double code(double eh, double ew, double t) {
double t_1 = ew * Math.cos(t);
double tmp;
if ((eh <= -2.7e-140) || !(eh <= 1.95e-138)) {
tmp = Math.abs((eh * ((Math.sin(t) * Math.sin(Math.atan(((eh * -Math.tan(t)) / ew)))) + (t_1 / eh))));
} else {
tmp = Math.abs(t_1);
}
return tmp;
}
def code(eh, ew, t): t_1 = ew * math.cos(t) tmp = 0 if (eh <= -2.7e-140) or not (eh <= 1.95e-138): tmp = math.fabs((eh * ((math.sin(t) * math.sin(math.atan(((eh * -math.tan(t)) / ew)))) + (t_1 / eh)))) else: tmp = math.fabs(t_1) return tmp
function code(eh, ew, t) t_1 = Float64(ew * cos(t)) tmp = 0.0 if ((eh <= -2.7e-140) || !(eh <= 1.95e-138)) tmp = abs(Float64(eh * Float64(Float64(sin(t) * sin(atan(Float64(Float64(eh * Float64(-tan(t))) / ew)))) + Float64(t_1 / eh)))); else tmp = abs(t_1); end return tmp end
function tmp_2 = code(eh, ew, t) t_1 = ew * cos(t); tmp = 0.0; if ((eh <= -2.7e-140) || ~((eh <= 1.95e-138))) tmp = abs((eh * ((sin(t) * sin(atan(((eh * -tan(t)) / ew)))) + (t_1 / eh)))); else tmp = abs(t_1); end tmp_2 = tmp; end
code[eh_, ew_, t_] := Block[{t$95$1 = N[(ew * N[Cos[t], $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[eh, -2.7e-140], N[Not[LessEqual[eh, 1.95e-138]], $MachinePrecision]], N[Abs[N[(eh * N[(N[(N[Sin[t], $MachinePrecision] * N[Sin[N[ArcTan[N[(N[(eh * (-N[Tan[t], $MachinePrecision])), $MachinePrecision] / ew), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + N[(t$95$1 / eh), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Abs[t$95$1], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := ew \cdot \cos t\\
\mathbf{if}\;eh \leq -2.7 \cdot 10^{-140} \lor \neg \left(eh \leq 1.95 \cdot 10^{-138}\right):\\
\;\;\;\;\left|eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\frac{eh \cdot \left(-\tan t\right)}{ew}\right) + \frac{t\_1}{eh}\right)\right|\\
\mathbf{else}:\\
\;\;\;\;\left|t\_1\right|\\
\end{array}
\end{array}
if eh < -2.7e-140 or 1.95e-138 < 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%
add-sqr-sqrt30.5%
sqrt-unprod99.2%
sqr-neg99.2%
sqrt-unprod68.6%
add-sqr-sqrt99.2%
associate-*r/99.2%
log1p-expm1-u99.2%
associate-*r/99.2%
cos-atan99.2%
associate-*l/99.2%
Applied egg-rr99.2%
Taylor expanded in eh around 0 98.8%
Taylor expanded in eh around inf 94.4%
if -2.7e-140 < eh < 1.95e-138Initial 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.9%
sqrt-unprod99.2%
sqr-neg99.2%
sqrt-unprod77.0%
add-sqr-sqrt99.2%
associate-*r/99.2%
log1p-expm1-u99.1%
associate-*r/99.1%
cos-atan99.1%
associate-*l/99.1%
Applied egg-rr99.1%
Taylor expanded in ew around inf 95.0%
Final simplification94.6%
(FPCore (eh ew t) :precision binary64 (fabs (- (/ 1.0 (/ (/ 1.0 ew) (cos t))) (* (* eh (sin t)) (sin (atan (/ (* eh (- (tan t))) ew)))))))
double code(double eh, double ew, double t) {
return fabs(((1.0 / ((1.0 / 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(((1.0d0 / ((1.0d0 / 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(((1.0 / ((1.0 / 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(((1.0 / ((1.0 / 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(1.0 / Float64(Float64(1.0 / ew) / cos(t))) - Float64(Float64(eh * sin(t)) * sin(atan(Float64(Float64(eh * Float64(-tan(t))) / ew)))))) end
function tmp = code(eh, ew, t) tmp = abs(((1.0 / ((1.0 / ew) / cos(t))) - ((eh * sin(t)) * sin(atan(((eh * -tan(t)) / ew)))))); end
code[eh_, ew_, t_] := N[Abs[N[(N[(1.0 / N[(N[(1.0 / ew), $MachinePrecision] / N[Cos[t], $MachinePrecision]), $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|\frac{1}{\frac{\frac{1}{ew}}{\cos t}} - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{eh \cdot \left(-\tan t\right)}{ew}\right)\right|
\end{array}
Initial program 99.8%
add-cbrt-cube58.0%
pow358.0%
Applied egg-rr59.8%
rem-cbrt-cube99.8%
clear-num99.7%
Applied egg-rr99.7%
Taylor expanded in eh around 0 98.8%
associate-/r*98.8%
Simplified98.8%
Final simplification98.8%
(FPCore (eh ew t)
:precision binary64
(let* ((t_1 (* (tan t) (/ eh ew))) (t_2 (fabs (* ew (cos t)))))
(if (<= ew -8.8e-110)
t_2
(if (<= ew 8.6e-186)
(fabs (* (* eh (sin t)) (sin (atan (- t_1)))))
(if (<= ew 5.8e+64)
(* ew (+ (cos t) (* eh (/ (* (sin t) (sin (atan t_1))) ew))))
t_2)))))
double code(double eh, double ew, double t) {
double t_1 = tan(t) * (eh / ew);
double t_2 = fabs((ew * cos(t)));
double tmp;
if (ew <= -8.8e-110) {
tmp = t_2;
} else if (ew <= 8.6e-186) {
tmp = fabs(((eh * sin(t)) * sin(atan(-t_1))));
} else if (ew <= 5.8e+64) {
tmp = ew * (cos(t) + (eh * ((sin(t) * sin(atan(t_1))) / 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 = tan(t) * (eh / ew)
t_2 = abs((ew * cos(t)))
if (ew <= (-8.8d-110)) then
tmp = t_2
else if (ew <= 8.6d-186) then
tmp = abs(((eh * sin(t)) * sin(atan(-t_1))))
else if (ew <= 5.8d+64) then
tmp = ew * (cos(t) + (eh * ((sin(t) * sin(atan(t_1))) / ew)))
else
tmp = t_2
end if
code = tmp
end function
public static double code(double eh, double ew, double t) {
double t_1 = Math.tan(t) * (eh / ew);
double t_2 = Math.abs((ew * Math.cos(t)));
double tmp;
if (ew <= -8.8e-110) {
tmp = t_2;
} else if (ew <= 8.6e-186) {
tmp = Math.abs(((eh * Math.sin(t)) * Math.sin(Math.atan(-t_1))));
} else if (ew <= 5.8e+64) {
tmp = ew * (Math.cos(t) + (eh * ((Math.sin(t) * Math.sin(Math.atan(t_1))) / ew)));
} else {
tmp = t_2;
}
return tmp;
}
def code(eh, ew, t): t_1 = math.tan(t) * (eh / ew) t_2 = math.fabs((ew * math.cos(t))) tmp = 0 if ew <= -8.8e-110: tmp = t_2 elif ew <= 8.6e-186: tmp = math.fabs(((eh * math.sin(t)) * math.sin(math.atan(-t_1)))) elif ew <= 5.8e+64: tmp = ew * (math.cos(t) + (eh * ((math.sin(t) * math.sin(math.atan(t_1))) / ew))) else: tmp = t_2 return tmp
function code(eh, ew, t) t_1 = Float64(tan(t) * Float64(eh / ew)) t_2 = abs(Float64(ew * cos(t))) tmp = 0.0 if (ew <= -8.8e-110) tmp = t_2; elseif (ew <= 8.6e-186) tmp = abs(Float64(Float64(eh * sin(t)) * sin(atan(Float64(-t_1))))); elseif (ew <= 5.8e+64) tmp = Float64(ew * Float64(cos(t) + Float64(eh * Float64(Float64(sin(t) * sin(atan(t_1))) / ew)))); else tmp = t_2; end return tmp end
function tmp_2 = code(eh, ew, t) t_1 = tan(t) * (eh / ew); t_2 = abs((ew * cos(t))); tmp = 0.0; if (ew <= -8.8e-110) tmp = t_2; elseif (ew <= 8.6e-186) tmp = abs(((eh * sin(t)) * sin(atan(-t_1)))); elseif (ew <= 5.8e+64) tmp = ew * (cos(t) + (eh * ((sin(t) * sin(atan(t_1))) / ew))); else tmp = t_2; 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[Abs[N[(ew * N[Cos[t], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[ew, -8.8e-110], t$95$2, If[LessEqual[ew, 8.6e-186], N[Abs[N[(N[(eh * N[Sin[t], $MachinePrecision]), $MachinePrecision] * N[Sin[N[ArcTan[(-t$95$1)], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[ew, 5.8e+64], N[(ew * N[(N[Cos[t], $MachinePrecision] + N[(eh * N[(N[(N[Sin[t], $MachinePrecision] * N[Sin[N[ArcTan[t$95$1], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / ew), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$2]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \tan t \cdot \frac{eh}{ew}\\
t_2 := \left|ew \cdot \cos t\right|\\
\mathbf{if}\;ew \leq -8.8 \cdot 10^{-110}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;ew \leq 8.6 \cdot 10^{-186}:\\
\;\;\;\;\left|\left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(-t\_1\right)\right|\\
\mathbf{elif}\;ew \leq 5.8 \cdot 10^{+64}:\\
\;\;\;\;ew \cdot \left(\cos t + eh \cdot \frac{\sin t \cdot \sin \tan^{-1} t\_1}{ew}\right)\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if ew < -8.7999999999999997e-110 or 5.79999999999999986e64 < 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-sqrt24.6%
sqrt-unprod99.2%
sqr-neg99.2%
sqrt-unprod74.4%
add-sqr-sqrt99.2%
associate-*r/99.2%
log1p-expm1-u99.2%
associate-*r/99.2%
cos-atan99.2%
associate-*l/99.2%
Applied egg-rr99.2%
Taylor expanded in ew around inf 82.6%
if -8.7999999999999997e-110 < ew < 8.5999999999999998e-186Initial 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%
add-sqr-sqrt41.7%
sqrt-unprod99.0%
sqr-neg99.0%
sqrt-unprod57.3%
add-sqr-sqrt99.0%
associate-*r/99.0%
log1p-expm1-u99.0%
associate-*r/99.0%
cos-atan99.0%
associate-*l/99.0%
Applied egg-rr99.0%
Taylor expanded in ew around 0 79.4%
mul-1-neg79.4%
associate-/l*79.4%
distribute-lft-neg-out79.4%
associate-*l*79.4%
*-commutative79.4%
distribute-lft-neg-out79.4%
associate-/l*79.4%
*-commutative79.4%
associate-*r/79.4%
distribute-rgt-neg-in79.4%
distribute-frac-neg79.4%
Simplified79.4%
if 8.5999999999999998e-186 < ew < 5.79999999999999986e64Initial program 99.9%
Applied egg-rr81.5%
Taylor expanded in ew around inf 82.1%
associate-/l*82.0%
*-commutative82.0%
associate-*r/82.0%
Simplified82.0%
Final simplification81.6%
(FPCore (eh ew t)
:precision binary64
(let* ((t_1 (fabs (* ew (cos t)))))
(if (<= ew -3.5e-110)
t_1
(if (<= ew 4.4e-166)
(fabs (* (* eh (sin t)) (sin (atan (- (* (tan t) (/ eh ew)))))))
(if (<= ew 1.02e-10)
(*
ew
(+ (cos t) (* eh (/ (* (sin t) (sin (atan (/ (* t eh) ew)))) ew))))
t_1)))))
double code(double eh, double ew, double t) {
double t_1 = fabs((ew * cos(t)));
double tmp;
if (ew <= -3.5e-110) {
tmp = t_1;
} else if (ew <= 4.4e-166) {
tmp = fabs(((eh * sin(t)) * sin(atan(-(tan(t) * (eh / ew))))));
} else if (ew <= 1.02e-10) {
tmp = ew * (cos(t) + (eh * ((sin(t) * sin(atan(((t * eh) / ew)))) / 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 <= (-3.5d-110)) then
tmp = t_1
else if (ew <= 4.4d-166) then
tmp = abs(((eh * sin(t)) * sin(atan(-(tan(t) * (eh / ew))))))
else if (ew <= 1.02d-10) then
tmp = ew * (cos(t) + (eh * ((sin(t) * sin(atan(((t * eh) / ew)))) / 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 <= -3.5e-110) {
tmp = t_1;
} else if (ew <= 4.4e-166) {
tmp = Math.abs(((eh * Math.sin(t)) * Math.sin(Math.atan(-(Math.tan(t) * (eh / ew))))));
} else if (ew <= 1.02e-10) {
tmp = ew * (Math.cos(t) + (eh * ((Math.sin(t) * Math.sin(Math.atan(((t * eh) / ew)))) / ew)));
} else {
tmp = t_1;
}
return tmp;
}
def code(eh, ew, t): t_1 = math.fabs((ew * math.cos(t))) tmp = 0 if ew <= -3.5e-110: tmp = t_1 elif ew <= 4.4e-166: tmp = math.fabs(((eh * math.sin(t)) * math.sin(math.atan(-(math.tan(t) * (eh / ew)))))) elif ew <= 1.02e-10: tmp = ew * (math.cos(t) + (eh * ((math.sin(t) * math.sin(math.atan(((t * eh) / ew)))) / ew))) else: tmp = t_1 return tmp
function code(eh, ew, t) t_1 = abs(Float64(ew * cos(t))) tmp = 0.0 if (ew <= -3.5e-110) tmp = t_1; elseif (ew <= 4.4e-166) tmp = abs(Float64(Float64(eh * sin(t)) * sin(atan(Float64(-Float64(tan(t) * Float64(eh / ew))))))); elseif (ew <= 1.02e-10) tmp = Float64(ew * Float64(cos(t) + Float64(eh * Float64(Float64(sin(t) * sin(atan(Float64(Float64(t * eh) / ew)))) / 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 <= -3.5e-110) tmp = t_1; elseif (ew <= 4.4e-166) tmp = abs(((eh * sin(t)) * sin(atan(-(tan(t) * (eh / ew)))))); elseif (ew <= 1.02e-10) tmp = ew * (cos(t) + (eh * ((sin(t) * sin(atan(((t * eh) / ew)))) / 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, -3.5e-110], t$95$1, If[LessEqual[ew, 4.4e-166], N[Abs[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]], $MachinePrecision], If[LessEqual[ew, 1.02e-10], N[(ew * N[(N[Cos[t], $MachinePrecision] + N[(eh * N[(N[(N[Sin[t], $MachinePrecision] * N[Sin[N[ArcTan[N[(N[(t * eh), $MachinePrecision] / ew), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / ew), $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 -3.5 \cdot 10^{-110}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;ew \leq 4.4 \cdot 10^{-166}:\\
\;\;\;\;\left|\left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(-\tan t \cdot \frac{eh}{ew}\right)\right|\\
\mathbf{elif}\;ew \leq 1.02 \cdot 10^{-10}:\\
\;\;\;\;ew \cdot \left(\cos t + eh \cdot \frac{\sin t \cdot \sin \tan^{-1} \left(\frac{t \cdot eh}{ew}\right)}{ew}\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if ew < -3.49999999999999974e-110 or 1.01999999999999997e-10 < 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.3%
sqrt-unprod99.3%
sqr-neg99.3%
sqrt-unprod75.8%
add-sqr-sqrt99.3%
associate-*r/99.3%
log1p-expm1-u99.2%
associate-*r/99.2%
cos-atan99.2%
associate-*l/99.2%
Applied egg-rr99.2%
Taylor expanded in ew around inf 81.9%
if -3.49999999999999974e-110 < ew < 4.4000000000000002e-166Initial 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%
add-sqr-sqrt39.8%
sqrt-unprod98.7%
sqr-neg98.7%
sqrt-unprod58.9%
add-sqr-sqrt98.7%
associate-*r/98.7%
log1p-expm1-u98.7%
associate-*r/98.7%
cos-atan98.7%
associate-*l/98.7%
Applied egg-rr98.7%
Taylor expanded in ew around 0 78.2%
mul-1-neg78.2%
associate-/l*78.2%
distribute-lft-neg-out78.2%
associate-*l*78.2%
*-commutative78.2%
distribute-lft-neg-out78.2%
associate-/l*78.2%
*-commutative78.2%
associate-*r/78.2%
distribute-rgt-neg-in78.2%
distribute-frac-neg78.2%
Simplified78.2%
if 4.4000000000000002e-166 < ew < 1.01999999999999997e-10Initial program 99.9%
Applied egg-rr79.1%
Taylor expanded in ew around inf 80.8%
associate-/l*80.7%
*-commutative80.7%
associate-*r/80.7%
Simplified80.7%
Taylor expanded in t around 0 87.5%
Final simplification81.4%
(FPCore (eh ew t)
:precision binary64
(let* ((t_1 (fabs (* ew (cos t)))))
(if (<= ew -7.5e-115)
t_1
(if (<= ew 4.6e-166)
(fabs (* (sin t) (* eh (sin (atan (- (* (tan t) (/ eh ew))))))))
(if (<= ew 1.35e-7)
(*
ew
(+ (cos t) (* eh (/ (* (sin t) (sin (atan (/ (* t eh) ew)))) ew))))
t_1)))))
double code(double eh, double ew, double t) {
double t_1 = fabs((ew * cos(t)));
double tmp;
if (ew <= -7.5e-115) {
tmp = t_1;
} else if (ew <= 4.6e-166) {
tmp = fabs((sin(t) * (eh * sin(atan(-(tan(t) * (eh / ew)))))));
} else if (ew <= 1.35e-7) {
tmp = ew * (cos(t) + (eh * ((sin(t) * sin(atan(((t * eh) / ew)))) / 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 <= (-7.5d-115)) then
tmp = t_1
else if (ew <= 4.6d-166) then
tmp = abs((sin(t) * (eh * sin(atan(-(tan(t) * (eh / ew)))))))
else if (ew <= 1.35d-7) then
tmp = ew * (cos(t) + (eh * ((sin(t) * sin(atan(((t * eh) / ew)))) / 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 <= -7.5e-115) {
tmp = t_1;
} else if (ew <= 4.6e-166) {
tmp = Math.abs((Math.sin(t) * (eh * Math.sin(Math.atan(-(Math.tan(t) * (eh / ew)))))));
} else if (ew <= 1.35e-7) {
tmp = ew * (Math.cos(t) + (eh * ((Math.sin(t) * Math.sin(Math.atan(((t * eh) / ew)))) / ew)));
} else {
tmp = t_1;
}
return tmp;
}
def code(eh, ew, t): t_1 = math.fabs((ew * math.cos(t))) tmp = 0 if ew <= -7.5e-115: tmp = t_1 elif ew <= 4.6e-166: tmp = math.fabs((math.sin(t) * (eh * math.sin(math.atan(-(math.tan(t) * (eh / ew))))))) elif ew <= 1.35e-7: tmp = ew * (math.cos(t) + (eh * ((math.sin(t) * math.sin(math.atan(((t * eh) / ew)))) / ew))) else: tmp = t_1 return tmp
function code(eh, ew, t) t_1 = abs(Float64(ew * cos(t))) tmp = 0.0 if (ew <= -7.5e-115) tmp = t_1; elseif (ew <= 4.6e-166) tmp = abs(Float64(sin(t) * Float64(eh * sin(atan(Float64(-Float64(tan(t) * Float64(eh / ew)))))))); elseif (ew <= 1.35e-7) tmp = Float64(ew * Float64(cos(t) + Float64(eh * Float64(Float64(sin(t) * sin(atan(Float64(Float64(t * eh) / ew)))) / 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 <= -7.5e-115) tmp = t_1; elseif (ew <= 4.6e-166) tmp = abs((sin(t) * (eh * sin(atan(-(tan(t) * (eh / ew))))))); elseif (ew <= 1.35e-7) tmp = ew * (cos(t) + (eh * ((sin(t) * sin(atan(((t * eh) / ew)))) / 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, -7.5e-115], t$95$1, If[LessEqual[ew, 4.6e-166], 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.35e-7], N[(ew * N[(N[Cos[t], $MachinePrecision] + N[(eh * N[(N[(N[Sin[t], $MachinePrecision] * N[Sin[N[ArcTan[N[(N[(t * eh), $MachinePrecision] / ew), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / ew), $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 -7.5 \cdot 10^{-115}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;ew \leq 4.6 \cdot 10^{-166}:\\
\;\;\;\;\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.35 \cdot 10^{-7}:\\
\;\;\;\;ew \cdot \left(\cos t + eh \cdot \frac{\sin t \cdot \sin \tan^{-1} \left(\frac{t \cdot eh}{ew}\right)}{ew}\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if ew < -7.50000000000000038e-115 or 1.35000000000000004e-7 < 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.3%
sqrt-unprod99.3%
sqr-neg99.3%
sqrt-unprod75.8%
add-sqr-sqrt99.3%
associate-*r/99.3%
log1p-expm1-u99.2%
associate-*r/99.2%
cos-atan99.2%
associate-*l/99.2%
Applied egg-rr99.2%
Taylor expanded in ew around inf 81.9%
if -7.50000000000000038e-115 < ew < 4.59999999999999997e-166Initial 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 78.2%
*-commutative78.2%
associate-*l*78.2%
*-commutative78.2%
associate-*r/78.2%
neg-mul-178.2%
*-commutative78.2%
distribute-lft-neg-in78.2%
associate-*r/78.2%
*-commutative78.2%
Simplified78.2%
if 4.59999999999999997e-166 < ew < 1.35000000000000004e-7Initial program 99.9%
Applied egg-rr79.1%
Taylor expanded in ew around inf 80.8%
associate-/l*80.7%
*-commutative80.7%
associate-*r/80.7%
Simplified80.7%
Taylor expanded in t around 0 87.5%
Final simplification81.4%
(FPCore (eh ew t) :precision binary64 (if (or (<= t -0.0031) (not (<= t 0.00036))) (fabs (* ew (cos t))) (fabs (- ew (* (* t eh) (sin (atan (- (* (tan t) (/ eh ew))))))))))
double code(double eh, double ew, double t) {
double tmp;
if ((t <= -0.0031) || !(t <= 0.00036)) {
tmp = fabs((ew * cos(t)));
} else {
tmp = fabs((ew - ((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 ((t <= (-0.0031d0)) .or. (.not. (t <= 0.00036d0))) then
tmp = abs((ew * cos(t)))
else
tmp = abs((ew - ((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 ((t <= -0.0031) || !(t <= 0.00036)) {
tmp = Math.abs((ew * Math.cos(t)));
} else {
tmp = Math.abs((ew - ((t * eh) * Math.sin(Math.atan(-(Math.tan(t) * (eh / ew)))))));
}
return tmp;
}
def code(eh, ew, t): tmp = 0 if (t <= -0.0031) or not (t <= 0.00036): tmp = math.fabs((ew * math.cos(t))) else: tmp = math.fabs((ew - ((t * eh) * math.sin(math.atan(-(math.tan(t) * (eh / ew))))))) return tmp
function code(eh, ew, t) tmp = 0.0 if ((t <= -0.0031) || !(t <= 0.00036)) tmp = abs(Float64(ew * cos(t))); else tmp = abs(Float64(ew - Float64(Float64(t * eh) * sin(atan(Float64(-Float64(tan(t) * Float64(eh / ew)))))))); end return tmp end
function tmp_2 = code(eh, ew, t) tmp = 0.0; if ((t <= -0.0031) || ~((t <= 0.00036))) tmp = abs((ew * cos(t))); else tmp = abs((ew - ((t * eh) * sin(atan(-(tan(t) * (eh / ew))))))); end tmp_2 = tmp; end
code[eh_, ew_, t_] := If[Or[LessEqual[t, -0.0031], N[Not[LessEqual[t, 0.00036]], $MachinePrecision]], N[Abs[N[(ew * N[Cos[t], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Abs[N[(ew - N[(N[(t * eh), $MachinePrecision] * 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}\;t \leq -0.0031 \lor \neg \left(t \leq 0.00036\right):\\
\;\;\;\;\left|ew \cdot \cos t\right|\\
\mathbf{else}:\\
\;\;\;\;\left|ew - \left(t \cdot eh\right) \cdot \sin \tan^{-1} \left(-\tan t \cdot \frac{eh}{ew}\right)\right|\\
\end{array}
\end{array}
if t < -0.00309999999999999989 or 3.60000000000000023e-4 < t Initial program 99.6%
fabs-sub99.6%
sub-neg99.6%
+-commutative99.6%
associate-*l*99.6%
distribute-rgt-neg-in99.6%
fma-define99.6%
Simplified99.6%
add-sqr-sqrt55.9%
sqrt-unprod99.3%
sqr-neg99.3%
sqrt-unprod43.2%
add-sqr-sqrt99.3%
associate-*r/99.3%
log1p-expm1-u99.3%
associate-*r/99.3%
cos-atan99.3%
associate-*l/99.3%
Applied egg-rr99.3%
Taylor expanded in ew around inf 52.2%
if -0.00309999999999999989 < t < 3.60000000000000023e-4Initial program 100.0%
add-cbrt-cube51.5%
pow351.5%
Applied egg-rr52.9%
Taylor expanded in t around 0 98.7%
mul-1-neg98.7%
unsub-neg98.7%
associate-*r*98.7%
mul-1-neg98.7%
associate-*l/98.7%
*-commutative98.7%
distribute-rgt-neg-in98.7%
Simplified98.7%
Final simplification75.4%
(FPCore (eh ew t)
:precision binary64
(let* ((t_1 (fabs (* ew (cos t)))))
(if (<= ew -1.25e-118)
t_1
(if (<= ew 2.5e-234)
(* (* eh (sin t)) (sin (atan (* (tan t) (/ eh ew)))))
(if (<= ew 2.1e-43)
(+ ew (* (* t eh) (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 <= -1.25e-118) {
tmp = t_1;
} else if (ew <= 2.5e-234) {
tmp = (eh * sin(t)) * sin(atan((tan(t) * (eh / ew))));
} else if (ew <= 2.1e-43) {
tmp = ew + ((t * eh) * 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 <= (-1.25d-118)) then
tmp = t_1
else if (ew <= 2.5d-234) then
tmp = (eh * sin(t)) * sin(atan((tan(t) * (eh / ew))))
else if (ew <= 2.1d-43) then
tmp = ew + ((t * eh) * 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 <= -1.25e-118) {
tmp = t_1;
} else if (ew <= 2.5e-234) {
tmp = (eh * Math.sin(t)) * Math.sin(Math.atan((Math.tan(t) * (eh / ew))));
} else if (ew <= 2.1e-43) {
tmp = ew + ((t * eh) * 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 <= -1.25e-118: tmp = t_1 elif ew <= 2.5e-234: tmp = (eh * math.sin(t)) * math.sin(math.atan((math.tan(t) * (eh / ew)))) elif ew <= 2.1e-43: tmp = ew + ((t * eh) * 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 <= -1.25e-118) tmp = t_1; elseif (ew <= 2.5e-234) tmp = Float64(Float64(eh * sin(t)) * sin(atan(Float64(tan(t) * Float64(eh / ew))))); elseif (ew <= 2.1e-43) tmp = Float64(ew + Float64(Float64(t * eh) * 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 <= -1.25e-118) tmp = t_1; elseif (ew <= 2.5e-234) tmp = (eh * sin(t)) * sin(atan((tan(t) * (eh / ew)))); elseif (ew <= 2.1e-43) tmp = ew + ((t * eh) * 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, -1.25e-118], t$95$1, If[LessEqual[ew, 2.5e-234], 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], If[LessEqual[ew, 2.1e-43], N[(ew + N[(N[(t * eh), $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 -1.25 \cdot 10^{-118}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;ew \leq 2.5 \cdot 10^{-234}:\\
\;\;\;\;\left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\tan t \cdot \frac{eh}{ew}\right)\\
\mathbf{elif}\;ew \leq 2.1 \cdot 10^{-43}:\\
\;\;\;\;ew + \left(t \cdot eh\right) \cdot \sin \tan^{-1} \left(eh \cdot \frac{\tan t}{ew}\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if ew < -1.25000000000000004e-118 or 2.1000000000000001e-43 < 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-sqrt25.0%
sqrt-unprod99.3%
sqr-neg99.3%
sqrt-unprod74.2%
add-sqr-sqrt99.3%
associate-*r/99.3%
log1p-expm1-u99.2%
associate-*r/99.2%
cos-atan99.2%
associate-*l/99.2%
Applied egg-rr99.2%
Taylor expanded in ew around inf 80.7%
if -1.25000000000000004e-118 < ew < 2.49999999999999989e-234Initial program 99.7%
Applied egg-rr53.5%
Taylor expanded in eh around inf 49.7%
*-commutative49.7%
associate-*r/49.7%
associate-*l*49.7%
Simplified49.7%
if 2.49999999999999989e-234 < ew < 2.1000000000000001e-43Initial program 100.0%
Applied egg-rr79.8%
Taylor expanded in t around 0 40.1%
Taylor expanded in t around 0 67.5%
associate-*r*67.5%
associate-*r/67.5%
Simplified67.5%
Final simplification71.0%
(FPCore (eh ew t) :precision binary64 (if (or (<= ew -5e-310) (not (<= ew 3.8e-44))) (fabs (* ew (cos t))) (+ ew (* (* t eh) (sin (atan (* eh (/ (tan t) ew))))))))
double code(double eh, double ew, double t) {
double tmp;
if ((ew <= -5e-310) || !(ew <= 3.8e-44)) {
tmp = fabs((ew * cos(t)));
} else {
tmp = ew + ((t * eh) * 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 <= (-5d-310)) .or. (.not. (ew <= 3.8d-44))) then
tmp = abs((ew * cos(t)))
else
tmp = ew + ((t * eh) * 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 <= -5e-310) || !(ew <= 3.8e-44)) {
tmp = Math.abs((ew * Math.cos(t)));
} else {
tmp = ew + ((t * eh) * Math.sin(Math.atan((eh * (Math.tan(t) / ew)))));
}
return tmp;
}
def code(eh, ew, t): tmp = 0 if (ew <= -5e-310) or not (ew <= 3.8e-44): tmp = math.fabs((ew * math.cos(t))) else: tmp = ew + ((t * eh) * math.sin(math.atan((eh * (math.tan(t) / ew))))) return tmp
function code(eh, ew, t) tmp = 0.0 if ((ew <= -5e-310) || !(ew <= 3.8e-44)) tmp = abs(Float64(ew * cos(t))); else tmp = Float64(ew + Float64(Float64(t * eh) * sin(atan(Float64(eh * Float64(tan(t) / ew)))))); end return tmp end
function tmp_2 = code(eh, ew, t) tmp = 0.0; if ((ew <= -5e-310) || ~((ew <= 3.8e-44))) tmp = abs((ew * cos(t))); else tmp = ew + ((t * eh) * sin(atan((eh * (tan(t) / ew))))); end tmp_2 = tmp; end
code[eh_, ew_, t_] := If[Or[LessEqual[ew, -5e-310], N[Not[LessEqual[ew, 3.8e-44]], $MachinePrecision]], N[Abs[N[(ew * N[Cos[t], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(ew + N[(N[(t * eh), $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 -5 \cdot 10^{-310} \lor \neg \left(ew \leq 3.8 \cdot 10^{-44}\right):\\
\;\;\;\;\left|ew \cdot \cos t\right|\\
\mathbf{else}:\\
\;\;\;\;ew + \left(t \cdot eh\right) \cdot \sin \tan^{-1} \left(eh \cdot \frac{\tan t}{ew}\right)\\
\end{array}
\end{array}
if ew < -4.999999999999985e-310 or 3.8000000000000001e-44 < 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-sqrt29.3%
sqrt-unprod99.4%
sqr-neg99.4%
sqrt-unprod70.0%
add-sqr-sqrt99.4%
associate-*r/99.4%
log1p-expm1-u99.4%
associate-*r/99.4%
cos-atan99.4%
associate-*l/99.4%
Applied egg-rr99.4%
Taylor expanded in ew around inf 70.0%
if -4.999999999999985e-310 < ew < 3.8000000000000001e-44Initial program 99.8%
Applied egg-rr74.4%
Taylor expanded in t around 0 28.0%
Taylor expanded in t around 0 58.6%
associate-*r*58.6%
associate-*r/58.6%
Simplified58.6%
Final simplification67.1%
(FPCore (eh ew t) :precision binary64 (if (or (<= ew -5e-310) (not (<= ew 1.75e-44))) (fabs (* ew (cos t))) (+ ew (* eh (* t (sin (atan (/ (* eh (tan t)) ew))))))))
double code(double eh, double ew, double t) {
double tmp;
if ((ew <= -5e-310) || !(ew <= 1.75e-44)) {
tmp = fabs((ew * cos(t)));
} else {
tmp = ew + (eh * (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 <= (-5d-310)) .or. (.not. (ew <= 1.75d-44))) then
tmp = abs((ew * cos(t)))
else
tmp = ew + (eh * (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 <= -5e-310) || !(ew <= 1.75e-44)) {
tmp = Math.abs((ew * Math.cos(t)));
} else {
tmp = ew + (eh * (t * Math.sin(Math.atan(((eh * Math.tan(t)) / ew)))));
}
return tmp;
}
def code(eh, ew, t): tmp = 0 if (ew <= -5e-310) or not (ew <= 1.75e-44): tmp = math.fabs((ew * math.cos(t))) else: tmp = ew + (eh * (t * math.sin(math.atan(((eh * math.tan(t)) / ew))))) return tmp
function code(eh, ew, t) tmp = 0.0 if ((ew <= -5e-310) || !(ew <= 1.75e-44)) tmp = abs(Float64(ew * cos(t))); else tmp = Float64(ew + Float64(eh * Float64(t * sin(atan(Float64(Float64(eh * tan(t)) / ew)))))); end return tmp end
function tmp_2 = code(eh, ew, t) tmp = 0.0; if ((ew <= -5e-310) || ~((ew <= 1.75e-44))) tmp = abs((ew * cos(t))); else tmp = ew + (eh * (t * sin(atan(((eh * tan(t)) / ew))))); end tmp_2 = tmp; end
code[eh_, ew_, t_] := If[Or[LessEqual[ew, -5e-310], N[Not[LessEqual[ew, 1.75e-44]], $MachinePrecision]], N[Abs[N[(ew * N[Cos[t], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], 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]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;ew \leq -5 \cdot 10^{-310} \lor \neg \left(ew \leq 1.75 \cdot 10^{-44}\right):\\
\;\;\;\;\left|ew \cdot \cos t\right|\\
\mathbf{else}:\\
\;\;\;\;ew + eh \cdot \left(t \cdot \sin \tan^{-1} \left(\frac{eh \cdot \tan t}{ew}\right)\right)\\
\end{array}
\end{array}
if ew < -4.999999999999985e-310 or 1.7499999999999999e-44 < 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-sqrt29.3%
sqrt-unprod99.4%
sqr-neg99.4%
sqrt-unprod70.0%
add-sqr-sqrt99.4%
associate-*r/99.4%
log1p-expm1-u99.4%
associate-*r/99.4%
cos-atan99.4%
associate-*l/99.4%
Applied egg-rr99.4%
Taylor expanded in ew around inf 70.0%
if -4.999999999999985e-310 < ew < 1.7499999999999999e-44Initial program 99.8%
Applied egg-rr74.4%
Taylor expanded in t around 0 58.6%
Final simplification67.1%
(FPCore (eh ew t) :precision binary64 (if (<= eh 1.5e+169) (fabs (* ew (cos t))) (fabs (* eh (* t (sin (atan (* eh (/ t (- ew))))))))))
double code(double eh, double ew, double t) {
double tmp;
if (eh <= 1.5e+169) {
tmp = fabs((ew * cos(t)));
} else {
tmp = fabs((eh * (t * sin(atan((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 (eh <= 1.5d+169) then
tmp = abs((ew * cos(t)))
else
tmp = abs((eh * (t * sin(atan((eh * (t / -ew)))))))
end if
code = tmp
end function
public static double code(double eh, double ew, double t) {
double tmp;
if (eh <= 1.5e+169) {
tmp = Math.abs((ew * Math.cos(t)));
} else {
tmp = Math.abs((eh * (t * Math.sin(Math.atan((eh * (t / -ew)))))));
}
return tmp;
}
def code(eh, ew, t): tmp = 0 if eh <= 1.5e+169: tmp = math.fabs((ew * math.cos(t))) else: tmp = math.fabs((eh * (t * math.sin(math.atan((eh * (t / -ew))))))) return tmp
function code(eh, ew, t) tmp = 0.0 if (eh <= 1.5e+169) tmp = abs(Float64(ew * cos(t))); else tmp = abs(Float64(eh * Float64(t * sin(atan(Float64(eh * Float64(t / Float64(-ew)))))))); end return tmp end
function tmp_2 = code(eh, ew, t) tmp = 0.0; if (eh <= 1.5e+169) tmp = abs((ew * cos(t))); else tmp = abs((eh * (t * sin(atan((eh * (t / -ew))))))); end tmp_2 = tmp; end
code[eh_, ew_, t_] := If[LessEqual[eh, 1.5e+169], N[Abs[N[(ew * N[Cos[t], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Abs[N[(eh * N[(t * N[Sin[N[ArcTan[N[(eh * N[(t / (-ew)), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;eh \leq 1.5 \cdot 10^{+169}:\\
\;\;\;\;\left|ew \cdot \cos t\right|\\
\mathbf{else}:\\
\;\;\;\;\left|eh \cdot \left(t \cdot \sin \tan^{-1} \left(eh \cdot \frac{t}{-ew}\right)\right)\right|\\
\end{array}
\end{array}
if eh < 1.5e169Initial 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-sqrt28.7%
sqrt-unprod99.1%
sqr-neg99.1%
sqrt-unprod70.3%
add-sqr-sqrt99.1%
associate-*r/99.1%
log1p-expm1-u99.1%
associate-*r/99.1%
cos-atan99.1%
associate-*l/99.1%
Applied egg-rr99.1%
Taylor expanded in ew around inf 66.5%
if 1.5e169 < eh Initial program 99.8%
Taylor expanded in t around 0 60.8%
+-commutative60.8%
fma-define60.8%
associate-*r/60.8%
neg-mul-160.8%
*-commutative60.8%
distribute-lft-neg-in60.8%
associate-*r/60.8%
*-commutative60.8%
mul-1-neg60.8%
associate-*r*60.8%
distribute-lft-neg-in60.8%
Simplified60.8%
Taylor expanded in t around 0 60.8%
mul-1-neg60.8%
associate-/l*60.8%
distribute-rgt-neg-in60.8%
Simplified60.8%
Taylor expanded in ew around 0 48.6%
associate-*r*48.6%
neg-mul-148.6%
mul-1-neg48.6%
associate-*r/48.6%
distribute-rgt-neg-in48.6%
Simplified48.6%
Final simplification64.8%
(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-sqrt27.9%
sqrt-unprod99.2%
sqr-neg99.2%
sqrt-unprod71.1%
add-sqr-sqrt99.2%
associate-*r/99.2%
log1p-expm1-u99.1%
associate-*r/99.1%
cos-atan99.1%
associate-*l/99.1%
Applied egg-rr99.1%
Taylor expanded in ew around inf 61.7%
(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-sqrt27.9%
sqrt-unprod99.2%
sqr-neg99.2%
sqrt-unprod71.1%
add-sqr-sqrt99.2%
associate-*r/99.2%
log1p-expm1-u99.1%
associate-*r/99.1%
cos-atan99.1%
associate-*l/99.1%
Applied egg-rr99.1%
Taylor expanded in t around 0 42.2%
(FPCore (eh ew t) :precision binary64 (+ ew (* -0.5 (* ew (* t t)))))
double code(double eh, double ew, double t) {
return ew + (-0.5 * (ew * (t * t)));
}
real(8) function code(eh, ew, t)
real(8), intent (in) :: eh
real(8), intent (in) :: ew
real(8), intent (in) :: t
code = ew + ((-0.5d0) * (ew * (t * t)))
end function
public static double code(double eh, double ew, double t) {
return ew + (-0.5 * (ew * (t * t)));
}
def code(eh, ew, t): return ew + (-0.5 * (ew * (t * t)))
function code(eh, ew, t) return Float64(ew + Float64(-0.5 * Float64(ew * Float64(t * t)))) end
function tmp = code(eh, ew, t) tmp = ew + (-0.5 * (ew * (t * t))); end
code[eh_, ew_, t_] := N[(ew + N[(-0.5 * N[(ew * N[(t * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
ew + -0.5 \cdot \left(ew \cdot \left(t \cdot t\right)\right)
\end{array}
Initial program 99.8%
Applied egg-rr52.3%
Taylor expanded in t around 0 18.0%
Taylor expanded in eh around 0 19.8%
unpow219.8%
Applied egg-rr19.8%
herbie shell --seed 2024144
(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)))))))