
(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 (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 (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 * tan(t)) / Float64(-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 \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%
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 * tan(t)) / Float64(-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 \tan t}{-ew}\right)\right|
\end{array}
Initial program 99.8%
add-cube-cbrt98.8%
pow398.8%
Applied egg-rr98.7%
rem-cube-cbrt99.8%
clear-num99.7%
Applied egg-rr99.7%
Final simplification99.7%
(FPCore (eh ew t) :precision binary64 (fabs (- (/ 1.0 (/ (/ (hypot 1.0 (* eh (/ (tan t) ew))) (cos t)) ew)) (* (* eh (sin t)) (sin (atan (/ (* eh (tan t)) (- ew))))))))
double code(double eh, double ew, double t) {
return fabs(((1.0 / ((hypot(1.0, (eh * (tan(t) / ew))) / cos(t)) / ew)) - ((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, (eh * (Math.tan(t) / ew))) / Math.cos(t)) / ew)) - ((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, (eh * (math.tan(t) / ew))) / math.cos(t)) / ew)) - ((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(hypot(1.0, Float64(eh * Float64(tan(t) / ew))) / cos(t)) / ew)) - Float64(Float64(eh * sin(t)) * sin(atan(Float64(Float64(eh * tan(t)) / Float64(-ew))))))) end
function tmp = code(eh, ew, t) tmp = abs(((1.0 / ((hypot(1.0, (eh * (tan(t) / ew))) / cos(t)) / ew)) - ((eh * sin(t)) * sin(atan(((eh * tan(t)) / -ew)))))); end
code[eh_, ew_, t_] := N[Abs[N[(N[(1.0 / N[(N[(N[Sqrt[1.0 ^ 2 + N[(eh * N[(N[Tan[t], $MachinePrecision] / ew), $MachinePrecision]), $MachinePrecision] ^ 2], $MachinePrecision] / N[Cos[t], $MachinePrecision]), $MachinePrecision] / ew), $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{\mathsf{hypot}\left(1, eh \cdot \frac{\tan t}{ew}\right)}{\cos t}}{ew}} - \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%
add-cube-cbrt98.8%
pow398.8%
Applied egg-rr98.7%
rem-cube-cbrt99.8%
clear-num99.7%
Applied egg-rr99.7%
associate-*r/99.7%
*-commutative99.7%
*-un-lft-identity99.7%
times-frac99.6%
*-commutative99.6%
associate-*r/99.6%
Applied egg-rr99.6%
associate-*l/99.6%
*-lft-identity99.6%
associate-*r/99.6%
associate-*l/99.6%
*-commutative99.6%
Simplified99.6%
Final simplification99.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 * tan(t)) / Float64(-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 \tan t}{-ew}\right)\right|
\end{array}
Initial program 99.8%
add-cube-cbrt98.8%
pow398.8%
Applied egg-rr98.7%
rem-cube-cbrt99.8%
clear-num99.7%
Applied egg-rr99.7%
Taylor expanded in eh around 0 98.1%
associate-/r*98.0%
Simplified98.0%
Final simplification98.0%
(FPCore (eh ew t)
:precision binary64
(let* ((t_1 (* ew (cos t))) (t_2 (fabs t_1)))
(if (<= ew -6e-104)
t_2
(if (<= ew 3.8e-269)
(fabs (* (* eh (sin t)) (sin (atan (* eh (/ t (- ew)))))))
(if (<= ew 7.5e+86)
(+ 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 <= -6e-104) {
tmp = t_2;
} else if (ew <= 3.8e-269) {
tmp = fabs(((eh * sin(t)) * sin(atan((eh * (t / -ew))))));
} else if (ew <= 7.5e+86) {
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 <= (-6d-104)) then
tmp = t_2
else if (ew <= 3.8d-269) then
tmp = abs(((eh * sin(t)) * sin(atan((eh * (t / -ew))))))
else if (ew <= 7.5d+86) 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 <= -6e-104) {
tmp = t_2;
} else if (ew <= 3.8e-269) {
tmp = Math.abs(((eh * Math.sin(t)) * Math.sin(Math.atan((eh * (t / -ew))))));
} else if (ew <= 7.5e+86) {
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 <= -6e-104: tmp = t_2 elif ew <= 3.8e-269: tmp = math.fabs(((eh * math.sin(t)) * math.sin(math.atan((eh * (t / -ew)))))) elif ew <= 7.5e+86: 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 <= -6e-104) tmp = t_2; elseif (ew <= 3.8e-269) tmp = abs(Float64(Float64(eh * sin(t)) * sin(atan(Float64(eh * Float64(t / Float64(-ew))))))); elseif (ew <= 7.5e+86) 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 <= -6e-104) tmp = t_2; elseif (ew <= 3.8e-269) tmp = abs(((eh * sin(t)) * sin(atan((eh * (t / -ew)))))); elseif (ew <= 7.5e+86) 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, -6e-104], t$95$2, If[LessEqual[ew, 3.8e-269], N[Abs[N[(N[(eh * N[Sin[t], $MachinePrecision]), $MachinePrecision] * N[Sin[N[ArcTan[N[(eh * N[(t / (-ew)), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[ew, 7.5e+86], 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 -6 \cdot 10^{-104}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;ew \leq 3.8 \cdot 10^{-269}:\\
\;\;\;\;\left|\left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(eh \cdot \frac{t}{-ew}\right)\right|\\
\mathbf{elif}\;ew \leq 7.5 \cdot 10^{+86}:\\
\;\;\;\;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 < -6.0000000000000005e-104 or 7.4999999999999997e86 < 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-log-exp99.6%
*-commutative99.6%
cos-atan99.6%
un-div-inv99.6%
add-sqr-sqrt27.4%
sqrt-unprod99.4%
sqr-neg99.4%
sqrt-unprod72.0%
add-sqr-sqrt98.6%
hypot-1-def98.6%
associate-*r/98.6%
*-commutative98.6%
associate-/l*98.6%
Applied egg-rr98.6%
Taylor expanded in ew around inf 88.3%
if -6.0000000000000005e-104 < ew < 3.8000000000000002e-269Initial 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-log-exp99.8%
*-commutative99.8%
cos-atan99.8%
un-div-inv99.8%
add-sqr-sqrt21.0%
sqrt-unprod99.8%
sqr-neg99.8%
sqrt-unprod78.8%
add-sqr-sqrt99.8%
hypot-1-def99.8%
associate-*r/99.8%
*-commutative99.8%
associate-/l*99.8%
Applied egg-rr99.8%
Taylor expanded in ew around 0 83.6%
associate-*r*83.6%
associate-*r/83.6%
neg-mul-183.6%
distribute-rgt-neg-out83.6%
associate-/l*83.6%
Simplified83.6%
Taylor expanded in t around 0 83.7%
mul-1-neg83.7%
associate-/l*83.7%
distribute-rgt-neg-in83.7%
distribute-neg-frac283.7%
Simplified83.7%
if 3.8000000000000002e-269 < ew < 7.4999999999999997e86Initial program 99.8%
Applied egg-rr46.5%
Taylor expanded in eh around 0 73.5%
Final simplification82.9%
(FPCore (eh ew t)
:precision binary64
(let* ((t_1 (fabs (* ew (cos t)))))
(if (<= ew -1.6e-170)
t_1
(if (<= ew -2.65e-303)
(fabs (* (sin (atan (* eh (/ t (- ew))))) (* eh t)))
(if (<= ew 4.2e-116)
(* eh (* (sin 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 <= -1.6e-170) {
tmp = t_1;
} else if (ew <= -2.65e-303) {
tmp = fabs((sin(atan((eh * (t / -ew)))) * (eh * t)));
} else if (ew <= 4.2e-116) {
tmp = eh * (sin(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 <= (-1.6d-170)) then
tmp = t_1
else if (ew <= (-2.65d-303)) then
tmp = abs((sin(atan((eh * (t / -ew)))) * (eh * t)))
else if (ew <= 4.2d-116) then
tmp = eh * (sin(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 <= -1.6e-170) {
tmp = t_1;
} else if (ew <= -2.65e-303) {
tmp = Math.abs((Math.sin(Math.atan((eh * (t / -ew)))) * (eh * t)));
} else if (ew <= 4.2e-116) {
tmp = eh * (Math.sin(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 <= -1.6e-170: tmp = t_1 elif ew <= -2.65e-303: tmp = math.fabs((math.sin(math.atan((eh * (t / -ew)))) * (eh * t))) elif ew <= 4.2e-116: tmp = eh * (math.sin(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 <= -1.6e-170) tmp = t_1; elseif (ew <= -2.65e-303) tmp = abs(Float64(sin(atan(Float64(eh * Float64(t / Float64(-ew))))) * Float64(eh * t))); elseif (ew <= 4.2e-116) tmp = Float64(eh * Float64(sin(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 <= -1.6e-170) tmp = t_1; elseif (ew <= -2.65e-303) tmp = abs((sin(atan((eh * (t / -ew)))) * (eh * t))); elseif (ew <= 4.2e-116) tmp = eh * (sin(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, -1.6e-170], t$95$1, If[LessEqual[ew, -2.65e-303], N[Abs[N[(N[Sin[N[ArcTan[N[(eh * N[(t / (-ew)), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * N[(eh * t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[ew, 4.2e-116], 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], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left|ew \cdot \cos t\right|\\
\mathbf{if}\;ew \leq -1.6 \cdot 10^{-170}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;ew \leq -2.65 \cdot 10^{-303}:\\
\;\;\;\;\left|\sin \tan^{-1} \left(eh \cdot \frac{t}{-ew}\right) \cdot \left(eh \cdot t\right)\right|\\
\mathbf{elif}\;ew \leq 4.2 \cdot 10^{-116}:\\
\;\;\;\;eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\frac{eh \cdot \tan t}{ew}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if ew < -1.6e-170 or 4.1999999999999998e-116 < 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-log-exp99.6%
*-commutative99.6%
cos-atan99.6%
un-div-inv99.6%
add-sqr-sqrt28.7%
sqrt-unprod99.5%
sqr-neg99.5%
sqrt-unprod70.8%
add-sqr-sqrt98.7%
hypot-1-def98.7%
associate-*r/98.7%
*-commutative98.7%
associate-/l*98.7%
Applied egg-rr98.7%
Taylor expanded in ew around inf 77.9%
if -1.6e-170 < ew < -2.65e-303Initial program 99.8%
Taylor expanded in t around 0 58.8%
+-commutative58.8%
fma-define58.8%
mul-1-neg58.8%
associate-*l/58.8%
distribute-rgt-neg-in58.8%
mul-1-neg58.8%
associate-*r*58.8%
distribute-rgt-neg-in58.8%
*-commutative58.8%
mul-1-neg58.8%
associate-*l/58.8%
distribute-rgt-neg-in58.8%
Simplified58.8%
Taylor expanded in ew around 0 51.8%
mul-1-neg51.8%
associate-*r*51.8%
*-commutative51.8%
distribute-rgt-neg-in51.8%
*-commutative51.8%
associate-*r/51.8%
neg-mul-151.8%
distribute-rgt-neg-out51.8%
associate-/l*51.8%
Simplified51.8%
Taylor expanded in t around 0 51.8%
mul-1-neg89.5%
associate-/l*89.5%
distribute-rgt-neg-in89.5%
distribute-neg-frac289.5%
Simplified51.8%
if -2.65e-303 < ew < 4.1999999999999998e-116Initial program 99.8%
Applied egg-rr43.5%
Taylor expanded in eh around inf 58.5%
Final simplification71.7%
(FPCore (eh ew t) :precision binary64 (if (or (<= ew -1.35e-101) (not (<= ew 5.6e-115))) (fabs (* ew (cos t))) (fabs (* (* eh (sin t)) (sin (atan (* eh (/ t (- ew)))))))))
double code(double eh, double ew, double t) {
double tmp;
if ((ew <= -1.35e-101) || !(ew <= 5.6e-115)) {
tmp = fabs((ew * cos(t)));
} else {
tmp = fabs(((eh * sin(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 ((ew <= (-1.35d-101)) .or. (.not. (ew <= 5.6d-115))) then
tmp = abs((ew * cos(t)))
else
tmp = abs(((eh * sin(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 ((ew <= -1.35e-101) || !(ew <= 5.6e-115)) {
tmp = Math.abs((ew * Math.cos(t)));
} else {
tmp = Math.abs(((eh * Math.sin(t)) * Math.sin(Math.atan((eh * (t / -ew))))));
}
return tmp;
}
def code(eh, ew, t): tmp = 0 if (ew <= -1.35e-101) or not (ew <= 5.6e-115): tmp = math.fabs((ew * math.cos(t))) else: tmp = math.fabs(((eh * math.sin(t)) * math.sin(math.atan((eh * (t / -ew)))))) return tmp
function code(eh, ew, t) tmp = 0.0 if ((ew <= -1.35e-101) || !(ew <= 5.6e-115)) tmp = abs(Float64(ew * cos(t))); else tmp = abs(Float64(Float64(eh * sin(t)) * sin(atan(Float64(eh * Float64(t / Float64(-ew))))))); end return tmp end
function tmp_2 = code(eh, ew, t) tmp = 0.0; if ((ew <= -1.35e-101) || ~((ew <= 5.6e-115))) tmp = abs((ew * cos(t))); else tmp = abs(((eh * sin(t)) * sin(atan((eh * (t / -ew)))))); end tmp_2 = tmp; end
code[eh_, ew_, t_] := If[Or[LessEqual[ew, -1.35e-101], N[Not[LessEqual[ew, 5.6e-115]], $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[(t / (-ew)), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;ew \leq -1.35 \cdot 10^{-101} \lor \neg \left(ew \leq 5.6 \cdot 10^{-115}\right):\\
\;\;\;\;\left|ew \cdot \cos t\right|\\
\mathbf{else}:\\
\;\;\;\;\left|\left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(eh \cdot \frac{t}{-ew}\right)\right|\\
\end{array}
\end{array}
if ew < -1.3500000000000001e-101 or 5.59999999999999974e-115 < 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-log-exp99.6%
*-commutative99.6%
cos-atan99.6%
un-div-inv99.6%
add-sqr-sqrt29.1%
sqrt-unprod99.5%
sqr-neg99.5%
sqrt-unprod70.3%
add-sqr-sqrt98.6%
hypot-1-def98.6%
associate-*r/98.6%
*-commutative98.6%
associate-/l*98.6%
Applied egg-rr98.6%
Taylor expanded in ew around inf 80.1%
if -1.3500000000000001e-101 < ew < 5.59999999999999974e-115Initial program 99.8%
fabs-sub99.8%
sub-neg99.8%
+-commutative99.8%
associate-*l*99.8%
distribute-rgt-neg-in99.8%
fma-define99.9%
Simplified99.9%
add-log-exp99.8%
*-commutative99.8%
cos-atan99.8%
un-div-inv99.8%
add-sqr-sqrt18.5%
sqrt-unprod99.2%
sqr-neg99.2%
sqrt-unprod80.7%
add-sqr-sqrt99.2%
hypot-1-def99.2%
associate-*r/99.2%
*-commutative99.2%
associate-/l*99.2%
Applied egg-rr99.2%
Taylor expanded in ew around 0 78.1%
associate-*r*78.1%
associate-*r/78.1%
neg-mul-178.1%
distribute-rgt-neg-out78.1%
associate-/l*78.1%
Simplified78.1%
Taylor expanded in t around 0 78.2%
mul-1-neg78.2%
associate-/l*78.2%
distribute-rgt-neg-in78.2%
distribute-neg-frac278.2%
Simplified78.2%
Final simplification79.5%
(FPCore (eh ew t)
:precision binary64
(let* ((t_1 (fabs (* ew (cos t)))))
(if (<= ew -1.6e-170)
t_1
(if (<= ew 1.75e-277)
(fabs (* (sin (atan (* eh (/ t (- ew))))) (* eh t)))
(if (<= ew 1.06e-123)
(+ 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 <= -1.6e-170) {
tmp = t_1;
} else if (ew <= 1.75e-277) {
tmp = fabs((sin(atan((eh * (t / -ew)))) * (eh * t)));
} else if (ew <= 1.06e-123) {
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 <= (-1.6d-170)) then
tmp = t_1
else if (ew <= 1.75d-277) then
tmp = abs((sin(atan((eh * (t / -ew)))) * (eh * t)))
else if (ew <= 1.06d-123) 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 <= -1.6e-170) {
tmp = t_1;
} else if (ew <= 1.75e-277) {
tmp = Math.abs((Math.sin(Math.atan((eh * (t / -ew)))) * (eh * t)));
} else if (ew <= 1.06e-123) {
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 <= -1.6e-170: tmp = t_1 elif ew <= 1.75e-277: tmp = math.fabs((math.sin(math.atan((eh * (t / -ew)))) * (eh * t))) elif ew <= 1.06e-123: 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 <= -1.6e-170) tmp = t_1; elseif (ew <= 1.75e-277) tmp = abs(Float64(sin(atan(Float64(eh * Float64(t / Float64(-ew))))) * Float64(eh * t))); elseif (ew <= 1.06e-123) 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 <= -1.6e-170) tmp = t_1; elseif (ew <= 1.75e-277) tmp = abs((sin(atan((eh * (t / -ew)))) * (eh * t))); elseif (ew <= 1.06e-123) 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, -1.6e-170], t$95$1, If[LessEqual[ew, 1.75e-277], N[Abs[N[(N[Sin[N[ArcTan[N[(eh * N[(t / (-ew)), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * N[(eh * t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[ew, 1.06e-123], 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 -1.6 \cdot 10^{-170}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;ew \leq 1.75 \cdot 10^{-277}:\\
\;\;\;\;\left|\sin \tan^{-1} \left(eh \cdot \frac{t}{-ew}\right) \cdot \left(eh \cdot t\right)\right|\\
\mathbf{elif}\;ew \leq 1.06 \cdot 10^{-123}:\\
\;\;\;\;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 < -1.6e-170 or 1.0599999999999999e-123 < 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-log-exp99.6%
*-commutative99.6%
cos-atan99.6%
un-div-inv99.6%
add-sqr-sqrt28.2%
sqrt-unprod99.5%
sqr-neg99.5%
sqrt-unprod71.2%
add-sqr-sqrt98.7%
hypot-1-def98.7%
associate-*r/98.7%
*-commutative98.7%
associate-/l*98.7%
Applied egg-rr98.7%
Taylor expanded in ew around inf 76.7%
if -1.6e-170 < ew < 1.74999999999999991e-277Initial program 99.8%
Taylor expanded in t around 0 52.0%
+-commutative52.0%
fma-define52.0%
mul-1-neg52.0%
associate-*l/52.0%
distribute-rgt-neg-in52.0%
mul-1-neg52.0%
associate-*r*52.0%
distribute-rgt-neg-in52.0%
*-commutative52.0%
mul-1-neg52.0%
associate-*l/52.0%
distribute-rgt-neg-in52.0%
Simplified52.0%
Taylor expanded in ew around 0 47.2%
mul-1-neg47.2%
associate-*r*47.2%
*-commutative47.2%
distribute-rgt-neg-in47.2%
*-commutative47.2%
associate-*r/47.2%
neg-mul-147.2%
distribute-rgt-neg-out47.2%
associate-/l*47.2%
Simplified47.2%
Taylor expanded in t around 0 47.2%
mul-1-neg92.7%
associate-/l*92.7%
distribute-rgt-neg-in92.7%
distribute-neg-frac292.7%
Simplified47.2%
if 1.74999999999999991e-277 < ew < 1.0599999999999999e-123Initial program 99.8%
Applied egg-rr44.2%
Taylor expanded in t around 0 58.8%
Final simplification70.1%
(FPCore (eh ew t) :precision binary64 (if (or (<= ew -1.5e-170) (not (<= ew 6.2e-228))) (fabs (* ew (cos t))) (fabs (* (sin (atan (* eh (/ t (- ew))))) (* eh t)))))
double code(double eh, double ew, double t) {
double tmp;
if ((ew <= -1.5e-170) || !(ew <= 6.2e-228)) {
tmp = fabs((ew * cos(t)));
} else {
tmp = fabs((sin(atan((eh * (t / -ew)))) * (eh * t)));
}
return tmp;
}
real(8) function code(eh, ew, t)
real(8), intent (in) :: eh
real(8), intent (in) :: ew
real(8), intent (in) :: t
real(8) :: tmp
if ((ew <= (-1.5d-170)) .or. (.not. (ew <= 6.2d-228))) then
tmp = abs((ew * cos(t)))
else
tmp = abs((sin(atan((eh * (t / -ew)))) * (eh * t)))
end if
code = tmp
end function
public static double code(double eh, double ew, double t) {
double tmp;
if ((ew <= -1.5e-170) || !(ew <= 6.2e-228)) {
tmp = Math.abs((ew * Math.cos(t)));
} else {
tmp = Math.abs((Math.sin(Math.atan((eh * (t / -ew)))) * (eh * t)));
}
return tmp;
}
def code(eh, ew, t): tmp = 0 if (ew <= -1.5e-170) or not (ew <= 6.2e-228): tmp = math.fabs((ew * math.cos(t))) else: tmp = math.fabs((math.sin(math.atan((eh * (t / -ew)))) * (eh * t))) return tmp
function code(eh, ew, t) tmp = 0.0 if ((ew <= -1.5e-170) || !(ew <= 6.2e-228)) tmp = abs(Float64(ew * cos(t))); else tmp = abs(Float64(sin(atan(Float64(eh * Float64(t / Float64(-ew))))) * Float64(eh * t))); end return tmp end
function tmp_2 = code(eh, ew, t) tmp = 0.0; if ((ew <= -1.5e-170) || ~((ew <= 6.2e-228))) tmp = abs((ew * cos(t))); else tmp = abs((sin(atan((eh * (t / -ew)))) * (eh * t))); end tmp_2 = tmp; end
code[eh_, ew_, t_] := If[Or[LessEqual[ew, -1.5e-170], N[Not[LessEqual[ew, 6.2e-228]], $MachinePrecision]], N[Abs[N[(ew * N[Cos[t], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Abs[N[(N[Sin[N[ArcTan[N[(eh * N[(t / (-ew)), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * N[(eh * t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;ew \leq -1.5 \cdot 10^{-170} \lor \neg \left(ew \leq 6.2 \cdot 10^{-228}\right):\\
\;\;\;\;\left|ew \cdot \cos t\right|\\
\mathbf{else}:\\
\;\;\;\;\left|\sin \tan^{-1} \left(eh \cdot \frac{t}{-ew}\right) \cdot \left(eh \cdot t\right)\right|\\
\end{array}
\end{array}
if ew < -1.50000000000000007e-170 or 6.1999999999999996e-228 < 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-log-exp99.7%
*-commutative99.7%
cos-atan99.7%
un-div-inv99.7%
add-sqr-sqrt26.9%
sqrt-unprod99.3%
sqr-neg99.3%
sqrt-unprod72.4%
add-sqr-sqrt98.6%
hypot-1-def98.6%
associate-*r/98.6%
*-commutative98.6%
associate-/l*98.6%
Applied egg-rr98.6%
Taylor expanded in ew around inf 72.4%
if -1.50000000000000007e-170 < ew < 6.1999999999999996e-228Initial program 99.8%
Taylor expanded in t around 0 55.3%
+-commutative55.3%
fma-define55.3%
mul-1-neg55.3%
associate-*l/55.3%
distribute-rgt-neg-in55.3%
mul-1-neg55.3%
associate-*r*55.3%
distribute-rgt-neg-in55.3%
*-commutative55.3%
mul-1-neg55.3%
associate-*l/55.3%
distribute-rgt-neg-in55.3%
Simplified55.3%
Taylor expanded in ew around 0 47.2%
mul-1-neg47.2%
associate-*r*47.2%
*-commutative47.2%
distribute-rgt-neg-in47.2%
*-commutative47.2%
associate-*r/47.2%
neg-mul-147.2%
distribute-rgt-neg-out47.2%
associate-/l*47.2%
Simplified47.2%
Taylor expanded in t around 0 47.2%
mul-1-neg89.8%
associate-/l*89.8%
distribute-rgt-neg-in89.8%
distribute-neg-frac289.8%
Simplified47.2%
Final simplification67.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-log-exp99.7%
*-commutative99.7%
cos-atan99.7%
un-div-inv99.7%
add-sqr-sqrt25.5%
sqrt-unprod99.4%
sqr-neg99.4%
sqrt-unprod73.8%
add-sqr-sqrt98.8%
hypot-1-def98.8%
associate-*r/98.8%
*-commutative98.8%
associate-/l*98.8%
Applied egg-rr98.8%
Taylor expanded in ew around inf 62.0%
(FPCore (eh ew t) :precision binary64 (if (or (<= t -0.041) (not (<= t 0.095))) (* (cos t) (- ew)) (fabs ew)))
double code(double eh, double ew, double t) {
double tmp;
if ((t <= -0.041) || !(t <= 0.095)) {
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.041d0)) .or. (.not. (t <= 0.095d0))) 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.041) || !(t <= 0.095)) {
tmp = Math.cos(t) * -ew;
} else {
tmp = Math.abs(ew);
}
return tmp;
}
def code(eh, ew, t): tmp = 0 if (t <= -0.041) or not (t <= 0.095): tmp = math.cos(t) * -ew else: tmp = math.fabs(ew) return tmp
function code(eh, ew, t) tmp = 0.0 if ((t <= -0.041) || !(t <= 0.095)) 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.041) || ~((t <= 0.095))) tmp = cos(t) * -ew; else tmp = abs(ew); end tmp_2 = tmp; end
code[eh_, ew_, t_] := If[Or[LessEqual[t, -0.041], N[Not[LessEqual[t, 0.095]], $MachinePrecision]], N[(N[Cos[t], $MachinePrecision] * (-ew)), $MachinePrecision], N[Abs[ew], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -0.041 \lor \neg \left(t \leq 0.095\right):\\
\;\;\;\;\cos t \cdot \left(-ew\right)\\
\mathbf{else}:\\
\;\;\;\;\left|ew\right|\\
\end{array}
\end{array}
if t < -0.0410000000000000017 or 0.095000000000000001 < t Initial program 99.6%
Applied egg-rr52.8%
neg-sub052.8%
associate-*r/52.8%
*-commutative52.8%
associate-/l*52.8%
associate-*r/52.8%
*-commutative52.8%
Simplified52.8%
Taylor expanded in eh around 0 29.5%
neg-mul-129.5%
distribute-rgt-neg-in29.5%
Simplified29.5%
if -0.0410000000000000017 < t < 0.095000000000000001Initial 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%
add-log-exp100.0%
*-commutative100.0%
cos-atan100.0%
un-div-inv100.0%
add-sqr-sqrt0.0%
sqrt-unprod99.6%
sqr-neg99.6%
sqrt-unprod99.6%
add-sqr-sqrt99.6%
hypot-1-def99.6%
associate-*r/99.6%
*-commutative99.6%
associate-/l*99.6%
Applied egg-rr99.6%
Taylor expanded in t around 0 71.4%
Final simplification51.4%
(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-log-exp99.7%
*-commutative99.7%
cos-atan99.7%
un-div-inv99.7%
add-sqr-sqrt25.5%
sqrt-unprod99.4%
sqr-neg99.4%
sqrt-unprod73.8%
add-sqr-sqrt98.8%
hypot-1-def98.8%
associate-*r/98.8%
*-commutative98.8%
associate-/l*98.8%
Applied egg-rr98.8%
Taylor expanded in t around 0 43.8%
(FPCore (eh ew t) :precision binary64 (if (<= ew -2e-310) (- ew) ew))
double code(double eh, double ew, double t) {
double tmp;
if (ew <= -2e-310) {
tmp = -ew;
} else {
tmp = 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 <= (-2d-310)) then
tmp = -ew
else
tmp = ew
end if
code = tmp
end function
public static double code(double eh, double ew, double t) {
double tmp;
if (ew <= -2e-310) {
tmp = -ew;
} else {
tmp = ew;
}
return tmp;
}
def code(eh, ew, t): tmp = 0 if ew <= -2e-310: tmp = -ew else: tmp = ew return tmp
function code(eh, ew, t) tmp = 0.0 if (ew <= -2e-310) tmp = Float64(-ew); else tmp = ew; end return tmp end
function tmp_2 = code(eh, ew, t) tmp = 0.0; if (ew <= -2e-310) tmp = -ew; else tmp = ew; end tmp_2 = tmp; end
code[eh_, ew_, t_] := If[LessEqual[ew, -2e-310], (-ew), ew]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;ew \leq -2 \cdot 10^{-310}:\\
\;\;\;\;-ew\\
\mathbf{else}:\\
\;\;\;\;ew\\
\end{array}
\end{array}
if ew < -1.999999999999994e-310Initial program 99.8%
Applied egg-rr77.9%
neg-sub077.9%
associate-*r/77.9%
*-commutative77.9%
associate-/l*77.9%
associate-*r/77.9%
*-commutative77.9%
Simplified77.9%
Taylor expanded in t around 0 46.0%
neg-mul-146.0%
Simplified46.0%
if -1.999999999999994e-310 < ew Initial program 99.8%
Applied egg-rr30.6%
Taylor expanded in t around 0 15.3%
rem-cbrt-cube42.0%
*-un-lft-identity42.0%
Applied egg-rr42.0%
Final simplification43.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%
Applied egg-rr50.6%
neg-sub050.6%
associate-*r/50.6%
*-commutative50.6%
associate-/l*50.6%
associate-*r/50.6%
*-commutative50.6%
Simplified50.6%
Taylor expanded in t around 0 21.0%
neg-mul-121.0%
Simplified21.0%
herbie shell --seed 2024152
(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)))))))