
(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 12 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 (fabs (- (/ (* ew (cos t)) (hypot 1.0 (* (tan t) (/ eh ew)))) (* (* eh (sin t)) (sin (atan (/ (* (tan t) (- eh)) 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(((tan(t) * -eh) / 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(((Math.tan(t) * -eh) / 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(((math.tan(t) * -eh) / ew))))))
function code(eh, ew, t) return abs(Float64(Float64(Float64(ew * cos(t)) / hypot(1.0, Float64(tan(t) * Float64(eh / ew)))) - Float64(Float64(eh * sin(t)) * sin(atan(Float64(Float64(tan(t) * Float64(-eh)) / 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(((tan(t) * -eh) / 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[(N[(eh * N[Sin[t], $MachinePrecision]), $MachinePrecision] * N[Sin[N[ArcTan[N[(N[(N[Tan[t], $MachinePrecision] * (-eh)), $MachinePrecision] / ew), $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)} - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\tan t \cdot \left(-eh\right)}{ew}\right)\right|
\end{array}
Initial program 99.8%
cos-atan99.8%
un-div-inv99.8%
hypot-1-def99.8%
*-commutative99.8%
associate-/l*99.8%
add-sqr-sqrt50.7%
sqrt-unprod95.1%
sqr-neg95.1%
sqrt-unprod49.1%
add-sqr-sqrt99.8%
Applied egg-rr99.8%
Final simplification99.8%
(FPCore (eh ew t)
:precision binary64
(let* ((t_1 (* (tan t) (/ eh ew))))
(fabs
(+
(/ (* ew (cos t)) (hypot 1.0 t_1))
(* eh (* (sin t) (sin (atan t_1))))))))
double code(double eh, double ew, double t) {
double t_1 = tan(t) * (eh / ew);
return fabs((((ew * cos(t)) / hypot(1.0, t_1)) + (eh * (sin(t) * sin(atan(t_1))))));
}
public static double code(double eh, double ew, double t) {
double t_1 = Math.tan(t) * (eh / ew);
return Math.abs((((ew * Math.cos(t)) / Math.hypot(1.0, t_1)) + (eh * (Math.sin(t) * Math.sin(Math.atan(t_1))))));
}
def code(eh, ew, t): t_1 = math.tan(t) * (eh / ew) return math.fabs((((ew * math.cos(t)) / math.hypot(1.0, t_1)) + (eh * (math.sin(t) * math.sin(math.atan(t_1))))))
function code(eh, ew, t) t_1 = Float64(tan(t) * Float64(eh / ew)) return abs(Float64(Float64(Float64(ew * cos(t)) / hypot(1.0, t_1)) + Float64(eh * Float64(sin(t) * sin(atan(t_1)))))) end
function tmp = code(eh, ew, t) t_1 = tan(t) * (eh / ew); tmp = abs((((ew * cos(t)) / hypot(1.0, t_1)) + (eh * (sin(t) * sin(atan(t_1)))))); end
code[eh_, ew_, t_] := Block[{t$95$1 = N[(N[Tan[t], $MachinePrecision] * N[(eh / ew), $MachinePrecision]), $MachinePrecision]}, N[Abs[N[(N[(N[(ew * N[Cos[t], $MachinePrecision]), $MachinePrecision] / N[Sqrt[1.0 ^ 2 + t$95$1 ^ 2], $MachinePrecision]), $MachinePrecision] + N[(eh * N[(N[Sin[t], $MachinePrecision] * N[Sin[N[ArcTan[t$95$1], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \tan t \cdot \frac{eh}{ew}\\
\left|\frac{ew \cdot \cos t}{\mathsf{hypot}\left(1, t\_1\right)} + eh \cdot \left(\sin t \cdot \sin \tan^{-1} t\_1\right)\right|
\end{array}
\end{array}
Initial program 99.8%
sub-neg99.8%
Applied egg-rr99.8%
(FPCore (eh ew t)
:precision binary64
(if (or (<= eh -1.9e+93) (not (<= eh 6.5e-5)))
(fabs
(*
eh
(-
(* ew (* (cos t) (/ 1.0 eh)))
(* (sin t) (sin (atan (* (tan t) (/ eh (- ew)))))))))
(fabs
(*
ew
(-
(cos t)
(/ (* (* eh (sin t)) (sin (atan (/ (* (tan t) (- eh)) ew)))) ew))))))
double code(double eh, double ew, double t) {
double tmp;
if ((eh <= -1.9e+93) || !(eh <= 6.5e-5)) {
tmp = fabs((eh * ((ew * (cos(t) * (1.0 / eh))) - (sin(t) * sin(atan((tan(t) * (eh / -ew))))))));
} else {
tmp = fabs((ew * (cos(t) - (((eh * sin(t)) * sin(atan(((tan(t) * -eh) / ew)))) / 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.9d+93)) .or. (.not. (eh <= 6.5d-5))) then
tmp = abs((eh * ((ew * (cos(t) * (1.0d0 / eh))) - (sin(t) * sin(atan((tan(t) * (eh / -ew))))))))
else
tmp = abs((ew * (cos(t) - (((eh * sin(t)) * sin(atan(((tan(t) * -eh) / ew)))) / ew))))
end if
code = tmp
end function
public static double code(double eh, double ew, double t) {
double tmp;
if ((eh <= -1.9e+93) || !(eh <= 6.5e-5)) {
tmp = Math.abs((eh * ((ew * (Math.cos(t) * (1.0 / eh))) - (Math.sin(t) * Math.sin(Math.atan((Math.tan(t) * (eh / -ew))))))));
} else {
tmp = Math.abs((ew * (Math.cos(t) - (((eh * Math.sin(t)) * Math.sin(Math.atan(((Math.tan(t) * -eh) / ew)))) / ew))));
}
return tmp;
}
def code(eh, ew, t): tmp = 0 if (eh <= -1.9e+93) or not (eh <= 6.5e-5): tmp = math.fabs((eh * ((ew * (math.cos(t) * (1.0 / eh))) - (math.sin(t) * math.sin(math.atan((math.tan(t) * (eh / -ew)))))))) else: tmp = math.fabs((ew * (math.cos(t) - (((eh * math.sin(t)) * math.sin(math.atan(((math.tan(t) * -eh) / ew)))) / ew)))) return tmp
function code(eh, ew, t) tmp = 0.0 if ((eh <= -1.9e+93) || !(eh <= 6.5e-5)) tmp = abs(Float64(eh * Float64(Float64(ew * Float64(cos(t) * Float64(1.0 / eh))) - Float64(sin(t) * sin(atan(Float64(tan(t) * Float64(eh / Float64(-ew))))))))); else tmp = abs(Float64(ew * Float64(cos(t) - Float64(Float64(Float64(eh * sin(t)) * sin(atan(Float64(Float64(tan(t) * Float64(-eh)) / ew)))) / ew)))); end return tmp end
function tmp_2 = code(eh, ew, t) tmp = 0.0; if ((eh <= -1.9e+93) || ~((eh <= 6.5e-5))) tmp = abs((eh * ((ew * (cos(t) * (1.0 / eh))) - (sin(t) * sin(atan((tan(t) * (eh / -ew)))))))); else tmp = abs((ew * (cos(t) - (((eh * sin(t)) * sin(atan(((tan(t) * -eh) / ew)))) / ew)))); end tmp_2 = tmp; end
code[eh_, ew_, t_] := If[Or[LessEqual[eh, -1.9e+93], N[Not[LessEqual[eh, 6.5e-5]], $MachinePrecision]], N[Abs[N[(eh * N[(N[(ew * N[(N[Cos[t], $MachinePrecision] * N[(1.0 / eh), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[Sin[t], $MachinePrecision] * N[Sin[N[ArcTan[N[(N[Tan[t], $MachinePrecision] * N[(eh / (-ew)), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Abs[N[(ew * N[(N[Cos[t], $MachinePrecision] - N[(N[(N[(eh * N[Sin[t], $MachinePrecision]), $MachinePrecision] * N[Sin[N[ArcTan[N[(N[(N[Tan[t], $MachinePrecision] * (-eh)), $MachinePrecision] / ew), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / ew), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;eh \leq -1.9 \cdot 10^{+93} \lor \neg \left(eh \leq 6.5 \cdot 10^{-5}\right):\\
\;\;\;\;\left|eh \cdot \left(ew \cdot \left(\cos t \cdot \frac{1}{eh}\right) - \sin t \cdot \sin \tan^{-1} \left(\tan t \cdot \frac{eh}{-ew}\right)\right)\right|\\
\mathbf{else}:\\
\;\;\;\;\left|ew \cdot \left(\cos t - \frac{\left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\tan t \cdot \left(-eh\right)}{ew}\right)}{ew}\right)\right|\\
\end{array}
\end{array}
if eh < -1.8999999999999999e93 or 6.49999999999999943e-5 < eh Initial program 99.8%
add-sqr-sqrt47.6%
pow247.6%
Applied egg-rr66.7%
Taylor expanded in ew around inf 46.4%
Taylor expanded in eh around inf 98.3%
associate-/l*98.3%
mul-1-neg98.3%
distribute-frac-neg298.3%
*-commutative98.3%
associate-*r/98.3%
Simplified98.3%
div-inv98.3%
Applied egg-rr98.3%
if -1.8999999999999999e93 < eh < 6.49999999999999943e-5Initial program 99.9%
add-sqr-sqrt53.6%
pow253.6%
Applied egg-rr56.4%
Taylor expanded in ew around inf 98.9%
mul-1-neg98.9%
unsub-neg98.9%
Simplified98.9%
Final simplification98.6%
(FPCore (eh ew t)
:precision binary64
(if (or (<= eh -1.95e+174) (not (<= eh 4.7e-5)))
(fabs
(*
eh
(-
(* ew (/ (cos t) eh))
(* (sin t) (sin (atan (* (tan t) (/ eh (- ew)))))))))
(fabs
(*
ew
(-
(cos t)
(/ (* (* eh (sin t)) (sin (atan (/ (* (tan t) (- eh)) ew)))) ew))))))
double code(double eh, double ew, double t) {
double tmp;
if ((eh <= -1.95e+174) || !(eh <= 4.7e-5)) {
tmp = fabs((eh * ((ew * (cos(t) / eh)) - (sin(t) * sin(atan((tan(t) * (eh / -ew))))))));
} else {
tmp = fabs((ew * (cos(t) - (((eh * sin(t)) * sin(atan(((tan(t) * -eh) / ew)))) / 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.95d+174)) .or. (.not. (eh <= 4.7d-5))) then
tmp = abs((eh * ((ew * (cos(t) / eh)) - (sin(t) * sin(atan((tan(t) * (eh / -ew))))))))
else
tmp = abs((ew * (cos(t) - (((eh * sin(t)) * sin(atan(((tan(t) * -eh) / ew)))) / ew))))
end if
code = tmp
end function
public static double code(double eh, double ew, double t) {
double tmp;
if ((eh <= -1.95e+174) || !(eh <= 4.7e-5)) {
tmp = Math.abs((eh * ((ew * (Math.cos(t) / eh)) - (Math.sin(t) * Math.sin(Math.atan((Math.tan(t) * (eh / -ew))))))));
} else {
tmp = Math.abs((ew * (Math.cos(t) - (((eh * Math.sin(t)) * Math.sin(Math.atan(((Math.tan(t) * -eh) / ew)))) / ew))));
}
return tmp;
}
def code(eh, ew, t): tmp = 0 if (eh <= -1.95e+174) or not (eh <= 4.7e-5): tmp = math.fabs((eh * ((ew * (math.cos(t) / eh)) - (math.sin(t) * math.sin(math.atan((math.tan(t) * (eh / -ew)))))))) else: tmp = math.fabs((ew * (math.cos(t) - (((eh * math.sin(t)) * math.sin(math.atan(((math.tan(t) * -eh) / ew)))) / ew)))) return tmp
function code(eh, ew, t) tmp = 0.0 if ((eh <= -1.95e+174) || !(eh <= 4.7e-5)) tmp = abs(Float64(eh * Float64(Float64(ew * Float64(cos(t) / eh)) - Float64(sin(t) * sin(atan(Float64(tan(t) * Float64(eh / Float64(-ew))))))))); else tmp = abs(Float64(ew * Float64(cos(t) - Float64(Float64(Float64(eh * sin(t)) * sin(atan(Float64(Float64(tan(t) * Float64(-eh)) / ew)))) / ew)))); end return tmp end
function tmp_2 = code(eh, ew, t) tmp = 0.0; if ((eh <= -1.95e+174) || ~((eh <= 4.7e-5))) tmp = abs((eh * ((ew * (cos(t) / eh)) - (sin(t) * sin(atan((tan(t) * (eh / -ew)))))))); else tmp = abs((ew * (cos(t) - (((eh * sin(t)) * sin(atan(((tan(t) * -eh) / ew)))) / ew)))); end tmp_2 = tmp; end
code[eh_, ew_, t_] := If[Or[LessEqual[eh, -1.95e+174], N[Not[LessEqual[eh, 4.7e-5]], $MachinePrecision]], N[Abs[N[(eh * N[(N[(ew * N[(N[Cos[t], $MachinePrecision] / eh), $MachinePrecision]), $MachinePrecision] - N[(N[Sin[t], $MachinePrecision] * N[Sin[N[ArcTan[N[(N[Tan[t], $MachinePrecision] * N[(eh / (-ew)), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Abs[N[(ew * N[(N[Cos[t], $MachinePrecision] - N[(N[(N[(eh * N[Sin[t], $MachinePrecision]), $MachinePrecision] * N[Sin[N[ArcTan[N[(N[(N[Tan[t], $MachinePrecision] * (-eh)), $MachinePrecision] / ew), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / ew), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;eh \leq -1.95 \cdot 10^{+174} \lor \neg \left(eh \leq 4.7 \cdot 10^{-5}\right):\\
\;\;\;\;\left|eh \cdot \left(ew \cdot \frac{\cos t}{eh} - \sin t \cdot \sin \tan^{-1} \left(\tan t \cdot \frac{eh}{-ew}\right)\right)\right|\\
\mathbf{else}:\\
\;\;\;\;\left|ew \cdot \left(\cos t - \frac{\left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\tan t \cdot \left(-eh\right)}{ew}\right)}{ew}\right)\right|\\
\end{array}
\end{array}
if eh < -1.9499999999999999e174 or 4.69999999999999972e-5 < eh Initial program 99.8%
add-sqr-sqrt49.3%
pow249.3%
Applied egg-rr68.7%
Taylor expanded in ew around inf 48.0%
Taylor expanded in eh around inf 98.2%
associate-/l*98.2%
mul-1-neg98.2%
distribute-frac-neg298.2%
*-commutative98.2%
associate-*r/98.2%
Simplified98.2%
if -1.9499999999999999e174 < eh < 4.69999999999999972e-5Initial program 99.8%
add-sqr-sqrt52.0%
pow252.0%
Applied egg-rr55.9%
Taylor expanded in ew around inf 98.9%
mul-1-neg98.9%
unsub-neg98.9%
Simplified98.9%
Final simplification98.6%
(FPCore (eh ew t)
:precision binary64
(if (or (<= eh -2e-153) (not (<= eh 5.15e-132)))
(fabs
(*
eh
(-
(* ew (/ (cos t) eh))
(* (sin t) (sin (atan (* (tan t) (/ eh (- ew)))))))))
(fabs (* ew (cos t)))))
double code(double eh, double ew, double t) {
double tmp;
if ((eh <= -2e-153) || !(eh <= 5.15e-132)) {
tmp = fabs((eh * ((ew * (cos(t) / eh)) - (sin(t) * sin(atan((tan(t) * (eh / -ew))))))));
} else {
tmp = fabs((ew * cos(t)));
}
return tmp;
}
real(8) function code(eh, ew, t)
real(8), intent (in) :: eh
real(8), intent (in) :: ew
real(8), intent (in) :: t
real(8) :: tmp
if ((eh <= (-2d-153)) .or. (.not. (eh <= 5.15d-132))) then
tmp = abs((eh * ((ew * (cos(t) / eh)) - (sin(t) * sin(atan((tan(t) * (eh / -ew))))))))
else
tmp = abs((ew * cos(t)))
end if
code = tmp
end function
public static double code(double eh, double ew, double t) {
double tmp;
if ((eh <= -2e-153) || !(eh <= 5.15e-132)) {
tmp = Math.abs((eh * ((ew * (Math.cos(t) / eh)) - (Math.sin(t) * Math.sin(Math.atan((Math.tan(t) * (eh / -ew))))))));
} else {
tmp = Math.abs((ew * Math.cos(t)));
}
return tmp;
}
def code(eh, ew, t): tmp = 0 if (eh <= -2e-153) or not (eh <= 5.15e-132): tmp = math.fabs((eh * ((ew * (math.cos(t) / eh)) - (math.sin(t) * math.sin(math.atan((math.tan(t) * (eh / -ew)))))))) else: tmp = math.fabs((ew * math.cos(t))) return tmp
function code(eh, ew, t) tmp = 0.0 if ((eh <= -2e-153) || !(eh <= 5.15e-132)) tmp = abs(Float64(eh * Float64(Float64(ew * Float64(cos(t) / eh)) - Float64(sin(t) * sin(atan(Float64(tan(t) * Float64(eh / Float64(-ew))))))))); else tmp = abs(Float64(ew * cos(t))); end return tmp end
function tmp_2 = code(eh, ew, t) tmp = 0.0; if ((eh <= -2e-153) || ~((eh <= 5.15e-132))) tmp = abs((eh * ((ew * (cos(t) / eh)) - (sin(t) * sin(atan((tan(t) * (eh / -ew)))))))); else tmp = abs((ew * cos(t))); end tmp_2 = tmp; end
code[eh_, ew_, t_] := If[Or[LessEqual[eh, -2e-153], N[Not[LessEqual[eh, 5.15e-132]], $MachinePrecision]], N[Abs[N[(eh * N[(N[(ew * N[(N[Cos[t], $MachinePrecision] / eh), $MachinePrecision]), $MachinePrecision] - N[(N[Sin[t], $MachinePrecision] * N[Sin[N[ArcTan[N[(N[Tan[t], $MachinePrecision] * N[(eh / (-ew)), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Abs[N[(ew * N[Cos[t], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;eh \leq -2 \cdot 10^{-153} \lor \neg \left(eh \leq 5.15 \cdot 10^{-132}\right):\\
\;\;\;\;\left|eh \cdot \left(ew \cdot \frac{\cos t}{eh} - \sin t \cdot \sin \tan^{-1} \left(\tan t \cdot \frac{eh}{-ew}\right)\right)\right|\\
\mathbf{else}:\\
\;\;\;\;\left|ew \cdot \cos t\right|\\
\end{array}
\end{array}
if eh < -2.00000000000000008e-153 or 5.1499999999999998e-132 < eh Initial program 99.8%
add-sqr-sqrt48.4%
pow248.4%
Applied egg-rr62.4%
Taylor expanded in ew around inf 47.0%
Taylor expanded in eh around inf 95.2%
associate-/l*95.1%
mul-1-neg95.1%
distribute-frac-neg295.1%
*-commutative95.1%
associate-*r/95.1%
Simplified95.1%
if -2.00000000000000008e-153 < eh < 5.1499999999999998e-132Initial program 99.8%
add-sqr-sqrt57.4%
pow257.4%
Applied egg-rr57.4%
Taylor expanded in ew around inf 57.3%
Taylor expanded in eh around inf 52.3%
associate-/l*52.3%
mul-1-neg52.3%
distribute-frac-neg252.3%
*-commutative52.3%
associate-*r/52.3%
Simplified52.3%
Taylor expanded in eh around 0 93.4%
Final simplification94.7%
(FPCore (eh ew t)
:precision binary64
(if (or (<= eh -3.9e+55) (not (<= eh 4e+36)))
(fabs
(*
(* eh (sin t))
(sin
(atan (/ (* t (- (* (* eh (pow t 2.0)) -0.3333333333333333) eh)) ew)))))
(fabs (* ew (cos t)))))
double code(double eh, double ew, double t) {
double tmp;
if ((eh <= -3.9e+55) || !(eh <= 4e+36)) {
tmp = fabs(((eh * sin(t)) * sin(atan(((t * (((eh * pow(t, 2.0)) * -0.3333333333333333) - eh)) / ew)))));
} else {
tmp = fabs((ew * cos(t)));
}
return tmp;
}
real(8) function code(eh, ew, t)
real(8), intent (in) :: eh
real(8), intent (in) :: ew
real(8), intent (in) :: t
real(8) :: tmp
if ((eh <= (-3.9d+55)) .or. (.not. (eh <= 4d+36))) then
tmp = abs(((eh * sin(t)) * sin(atan(((t * (((eh * (t ** 2.0d0)) * (-0.3333333333333333d0)) - eh)) / ew)))))
else
tmp = abs((ew * cos(t)))
end if
code = tmp
end function
public static double code(double eh, double ew, double t) {
double tmp;
if ((eh <= -3.9e+55) || !(eh <= 4e+36)) {
tmp = Math.abs(((eh * Math.sin(t)) * Math.sin(Math.atan(((t * (((eh * Math.pow(t, 2.0)) * -0.3333333333333333) - eh)) / ew)))));
} else {
tmp = Math.abs((ew * Math.cos(t)));
}
return tmp;
}
def code(eh, ew, t): tmp = 0 if (eh <= -3.9e+55) or not (eh <= 4e+36): tmp = math.fabs(((eh * math.sin(t)) * math.sin(math.atan(((t * (((eh * math.pow(t, 2.0)) * -0.3333333333333333) - eh)) / ew))))) else: tmp = math.fabs((ew * math.cos(t))) return tmp
function code(eh, ew, t) tmp = 0.0 if ((eh <= -3.9e+55) || !(eh <= 4e+36)) tmp = abs(Float64(Float64(eh * sin(t)) * sin(atan(Float64(Float64(t * Float64(Float64(Float64(eh * (t ^ 2.0)) * -0.3333333333333333) - eh)) / ew))))); else tmp = abs(Float64(ew * cos(t))); end return tmp end
function tmp_2 = code(eh, ew, t) tmp = 0.0; if ((eh <= -3.9e+55) || ~((eh <= 4e+36))) tmp = abs(((eh * sin(t)) * sin(atan(((t * (((eh * (t ^ 2.0)) * -0.3333333333333333) - eh)) / ew))))); else tmp = abs((ew * cos(t))); end tmp_2 = tmp; end
code[eh_, ew_, t_] := If[Or[LessEqual[eh, -3.9e+55], N[Not[LessEqual[eh, 4e+36]], $MachinePrecision]], N[Abs[N[(N[(eh * N[Sin[t], $MachinePrecision]), $MachinePrecision] * N[Sin[N[ArcTan[N[(N[(t * N[(N[(N[(eh * N[Power[t, 2.0], $MachinePrecision]), $MachinePrecision] * -0.3333333333333333), $MachinePrecision] - eh), $MachinePrecision]), $MachinePrecision] / ew), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Abs[N[(ew * N[Cos[t], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;eh \leq -3.9 \cdot 10^{+55} \lor \neg \left(eh \leq 4 \cdot 10^{+36}\right):\\
\;\;\;\;\left|\left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{t \cdot \left(\left(eh \cdot {t}^{2}\right) \cdot -0.3333333333333333 - eh\right)}{ew}\right)\right|\\
\mathbf{else}:\\
\;\;\;\;\left|ew \cdot \cos t\right|\\
\end{array}
\end{array}
if eh < -3.90000000000000027e55 or 4.00000000000000017e36 < eh Initial program 99.8%
Taylor expanded in ew around inf 82.8%
+-commutative82.8%
mul-1-neg82.8%
unsub-neg82.8%
Simplified82.7%
Taylor expanded in ew around 0 75.9%
mul-1-neg75.9%
associate-*r*75.9%
distribute-lft-neg-in75.9%
mul-1-neg75.9%
associate-*r/75.8%
distribute-lft-neg-out75.8%
*-commutative75.8%
distribute-lft-neg-out75.8%
associate-*r/75.9%
mul-1-neg75.9%
Simplified75.9%
Taylor expanded in t around 0 76.0%
neg-mul-176.0%
+-commutative76.0%
unsub-neg76.0%
*-commutative76.0%
Simplified76.0%
if -3.90000000000000027e55 < eh < 4.00000000000000017e36Initial program 99.9%
add-sqr-sqrt54.1%
pow254.1%
Applied egg-rr56.9%
Taylor expanded in ew around inf 53.2%
Taylor expanded in eh around inf 71.9%
associate-/l*71.8%
mul-1-neg71.8%
distribute-frac-neg271.8%
*-commutative71.8%
associate-*r/71.8%
Simplified71.8%
Taylor expanded in eh around 0 83.2%
Final simplification80.1%
(FPCore (eh ew t) :precision binary64 (if (or (<= eh -9e+58) (not (<= eh 1.3e+35))) (fabs (* (* eh (sin t)) (sin (atan (/ (* (tan t) (- eh)) ew))))) (fabs (* ew (cos t)))))
double code(double eh, double ew, double t) {
double tmp;
if ((eh <= -9e+58) || !(eh <= 1.3e+35)) {
tmp = fabs(((eh * sin(t)) * sin(atan(((tan(t) * -eh) / ew)))));
} else {
tmp = fabs((ew * cos(t)));
}
return tmp;
}
real(8) function code(eh, ew, t)
real(8), intent (in) :: eh
real(8), intent (in) :: ew
real(8), intent (in) :: t
real(8) :: tmp
if ((eh <= (-9d+58)) .or. (.not. (eh <= 1.3d+35))) then
tmp = abs(((eh * sin(t)) * sin(atan(((tan(t) * -eh) / ew)))))
else
tmp = abs((ew * cos(t)))
end if
code = tmp
end function
public static double code(double eh, double ew, double t) {
double tmp;
if ((eh <= -9e+58) || !(eh <= 1.3e+35)) {
tmp = Math.abs(((eh * Math.sin(t)) * Math.sin(Math.atan(((Math.tan(t) * -eh) / ew)))));
} else {
tmp = Math.abs((ew * Math.cos(t)));
}
return tmp;
}
def code(eh, ew, t): tmp = 0 if (eh <= -9e+58) or not (eh <= 1.3e+35): tmp = math.fabs(((eh * math.sin(t)) * math.sin(math.atan(((math.tan(t) * -eh) / ew))))) else: tmp = math.fabs((ew * math.cos(t))) return tmp
function code(eh, ew, t) tmp = 0.0 if ((eh <= -9e+58) || !(eh <= 1.3e+35)) tmp = abs(Float64(Float64(eh * sin(t)) * sin(atan(Float64(Float64(tan(t) * Float64(-eh)) / ew))))); else tmp = abs(Float64(ew * cos(t))); end return tmp end
function tmp_2 = code(eh, ew, t) tmp = 0.0; if ((eh <= -9e+58) || ~((eh <= 1.3e+35))) tmp = abs(((eh * sin(t)) * sin(atan(((tan(t) * -eh) / ew))))); else tmp = abs((ew * cos(t))); end tmp_2 = tmp; end
code[eh_, ew_, t_] := If[Or[LessEqual[eh, -9e+58], N[Not[LessEqual[eh, 1.3e+35]], $MachinePrecision]], N[Abs[N[(N[(eh * N[Sin[t], $MachinePrecision]), $MachinePrecision] * N[Sin[N[ArcTan[N[(N[(N[Tan[t], $MachinePrecision] * (-eh)), $MachinePrecision] / ew), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Abs[N[(ew * N[Cos[t], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;eh \leq -9 \cdot 10^{+58} \lor \neg \left(eh \leq 1.3 \cdot 10^{+35}\right):\\
\;\;\;\;\left|\left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\tan t \cdot \left(-eh\right)}{ew}\right)\right|\\
\mathbf{else}:\\
\;\;\;\;\left|ew \cdot \cos t\right|\\
\end{array}
\end{array}
if eh < -8.9999999999999996e58 or 1.30000000000000003e35 < eh Initial program 99.8%
Taylor expanded in ew around inf 82.8%
+-commutative82.8%
mul-1-neg82.8%
unsub-neg82.8%
Simplified82.7%
Taylor expanded in ew around 0 75.9%
mul-1-neg75.9%
associate-*r*75.9%
distribute-lft-neg-in75.9%
mul-1-neg75.9%
associate-*r/75.8%
distribute-lft-neg-out75.8%
*-commutative75.8%
distribute-lft-neg-out75.8%
associate-*r/75.9%
mul-1-neg75.9%
Simplified75.9%
if -8.9999999999999996e58 < eh < 1.30000000000000003e35Initial program 99.9%
add-sqr-sqrt54.1%
pow254.1%
Applied egg-rr56.9%
Taylor expanded in ew around inf 53.2%
Taylor expanded in eh around inf 71.9%
associate-/l*71.8%
mul-1-neg71.8%
distribute-frac-neg271.8%
*-commutative71.8%
associate-*r/71.8%
Simplified71.8%
Taylor expanded in eh around 0 83.2%
Final simplification80.0%
(FPCore (eh ew t) :precision binary64 (if (or (<= eh -6.6e+58) (not (<= eh 1.02e+37))) (fabs (* (* eh (sin t)) (sin (atan (* eh (- (/ (tan t) ew))))))) (fabs (* ew (cos t)))))
double code(double eh, double ew, double t) {
double tmp;
if ((eh <= -6.6e+58) || !(eh <= 1.02e+37)) {
tmp = fabs(((eh * sin(t)) * sin(atan((eh * -(tan(t) / ew))))));
} else {
tmp = fabs((ew * cos(t)));
}
return tmp;
}
real(8) function code(eh, ew, t)
real(8), intent (in) :: eh
real(8), intent (in) :: ew
real(8), intent (in) :: t
real(8) :: tmp
if ((eh <= (-6.6d+58)) .or. (.not. (eh <= 1.02d+37))) then
tmp = abs(((eh * sin(t)) * sin(atan((eh * -(tan(t) / ew))))))
else
tmp = abs((ew * cos(t)))
end if
code = tmp
end function
public static double code(double eh, double ew, double t) {
double tmp;
if ((eh <= -6.6e+58) || !(eh <= 1.02e+37)) {
tmp = Math.abs(((eh * Math.sin(t)) * Math.sin(Math.atan((eh * -(Math.tan(t) / ew))))));
} else {
tmp = Math.abs((ew * Math.cos(t)));
}
return tmp;
}
def code(eh, ew, t): tmp = 0 if (eh <= -6.6e+58) or not (eh <= 1.02e+37): tmp = math.fabs(((eh * math.sin(t)) * math.sin(math.atan((eh * -(math.tan(t) / ew)))))) else: tmp = math.fabs((ew * math.cos(t))) return tmp
function code(eh, ew, t) tmp = 0.0 if ((eh <= -6.6e+58) || !(eh <= 1.02e+37)) tmp = abs(Float64(Float64(eh * sin(t)) * sin(atan(Float64(eh * Float64(-Float64(tan(t) / ew))))))); else tmp = abs(Float64(ew * cos(t))); end return tmp end
function tmp_2 = code(eh, ew, t) tmp = 0.0; if ((eh <= -6.6e+58) || ~((eh <= 1.02e+37))) tmp = abs(((eh * sin(t)) * sin(atan((eh * -(tan(t) / ew)))))); else tmp = abs((ew * cos(t))); end tmp_2 = tmp; end
code[eh_, ew_, t_] := If[Or[LessEqual[eh, -6.6e+58], N[Not[LessEqual[eh, 1.02e+37]], $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], N[Abs[N[(ew * N[Cos[t], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;eh \leq -6.6 \cdot 10^{+58} \lor \neg \left(eh \leq 1.02 \cdot 10^{+37}\right):\\
\;\;\;\;\left|\left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(eh \cdot \left(-\frac{\tan t}{ew}\right)\right)\right|\\
\mathbf{else}:\\
\;\;\;\;\left|ew \cdot \cos t\right|\\
\end{array}
\end{array}
if eh < -6.59999999999999966e58 or 1.01999999999999995e37 < eh Initial program 99.8%
Taylor expanded in ew around 0 75.9%
mul-1-neg75.9%
associate-*r*75.9%
*-commutative75.9%
distribute-rgt-neg-in75.9%
mul-1-neg75.9%
distribute-frac-neg275.9%
*-rgt-identity75.9%
associate-*r/75.9%
associate-*l*75.8%
associate-*r/75.8%
*-rgt-identity75.8%
distribute-rgt-neg-in75.8%
Simplified75.8%
if -6.59999999999999966e58 < eh < 1.01999999999999995e37Initial program 99.9%
add-sqr-sqrt54.1%
pow254.1%
Applied egg-rr56.9%
Taylor expanded in ew around inf 53.2%
Taylor expanded in eh around inf 71.9%
associate-/l*71.8%
mul-1-neg71.8%
distribute-frac-neg271.8%
*-commutative71.8%
associate-*r/71.8%
Simplified71.8%
Taylor expanded in eh around 0 83.2%
Final simplification80.0%
(FPCore (eh ew t) :precision binary64 (if (or (<= t -2.45e-6) (not (<= t 0.14))) (fabs (* ew (cos t))) (fabs (- ew (* (sin (atan (/ (* (tan t) (- eh)) ew))) (* t eh))))))
double code(double eh, double ew, double t) {
double tmp;
if ((t <= -2.45e-6) || !(t <= 0.14)) {
tmp = fabs((ew * cos(t)));
} else {
tmp = fabs((ew - (sin(atan(((tan(t) * -eh) / ew))) * (t * eh))));
}
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 <= (-2.45d-6)) .or. (.not. (t <= 0.14d0))) then
tmp = abs((ew * cos(t)))
else
tmp = abs((ew - (sin(atan(((tan(t) * -eh) / ew))) * (t * eh))))
end if
code = tmp
end function
public static double code(double eh, double ew, double t) {
double tmp;
if ((t <= -2.45e-6) || !(t <= 0.14)) {
tmp = Math.abs((ew * Math.cos(t)));
} else {
tmp = Math.abs((ew - (Math.sin(Math.atan(((Math.tan(t) * -eh) / ew))) * (t * eh))));
}
return tmp;
}
def code(eh, ew, t): tmp = 0 if (t <= -2.45e-6) or not (t <= 0.14): tmp = math.fabs((ew * math.cos(t))) else: tmp = math.fabs((ew - (math.sin(math.atan(((math.tan(t) * -eh) / ew))) * (t * eh)))) return tmp
function code(eh, ew, t) tmp = 0.0 if ((t <= -2.45e-6) || !(t <= 0.14)) tmp = abs(Float64(ew * cos(t))); else tmp = abs(Float64(ew - Float64(sin(atan(Float64(Float64(tan(t) * Float64(-eh)) / ew))) * Float64(t * eh)))); end return tmp end
function tmp_2 = code(eh, ew, t) tmp = 0.0; if ((t <= -2.45e-6) || ~((t <= 0.14))) tmp = abs((ew * cos(t))); else tmp = abs((ew - (sin(atan(((tan(t) * -eh) / ew))) * (t * eh)))); end tmp_2 = tmp; end
code[eh_, ew_, t_] := If[Or[LessEqual[t, -2.45e-6], N[Not[LessEqual[t, 0.14]], $MachinePrecision]], N[Abs[N[(ew * N[Cos[t], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Abs[N[(ew - N[(N[Sin[N[ArcTan[N[(N[(N[Tan[t], $MachinePrecision] * (-eh)), $MachinePrecision] / ew), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * N[(t * eh), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.45 \cdot 10^{-6} \lor \neg \left(t \leq 0.14\right):\\
\;\;\;\;\left|ew \cdot \cos t\right|\\
\mathbf{else}:\\
\;\;\;\;\left|ew - \sin \tan^{-1} \left(\frac{\tan t \cdot \left(-eh\right)}{ew}\right) \cdot \left(t \cdot eh\right)\right|\\
\end{array}
\end{array}
if t < -2.44999999999999984e-6 or 0.14000000000000001 < t Initial program 99.6%
add-sqr-sqrt47.2%
pow247.2%
Applied egg-rr58.2%
Taylor expanded in ew around inf 46.3%
Taylor expanded in eh around inf 78.2%
associate-/l*78.2%
mul-1-neg78.2%
distribute-frac-neg278.2%
*-commutative78.2%
associate-*r/78.2%
Simplified78.2%
Taylor expanded in eh around 0 50.8%
if -2.44999999999999984e-6 < t < 0.14000000000000001Initial program 100.0%
add-sqr-sqrt54.1%
pow254.1%
Applied egg-rr63.5%
Taylor expanded in t around 0 97.5%
mul-1-neg97.5%
unsub-neg97.5%
associate-*r*97.5%
*-commutative97.5%
mul-1-neg97.5%
associate-*r/97.5%
distribute-rgt-neg-in97.5%
distribute-frac-neg297.5%
distribute-frac-neg297.5%
distribute-rgt-neg-in97.5%
distribute-lft-neg-out97.5%
associate-*r/97.5%
*-commutative97.5%
Simplified97.5%
Final simplification75.9%
(FPCore (eh ew t) :precision binary64 (if (or (<= eh -4.7e+130) (not (<= eh 3.8e+121))) (fabs (* eh (* t (sin (atan (* eh (/ (- t) ew))))))) (fabs (* ew (cos t)))))
double code(double eh, double ew, double t) {
double tmp;
if ((eh <= -4.7e+130) || !(eh <= 3.8e+121)) {
tmp = fabs((eh * (t * sin(atan((eh * (-t / ew)))))));
} else {
tmp = fabs((ew * cos(t)));
}
return tmp;
}
real(8) function code(eh, ew, t)
real(8), intent (in) :: eh
real(8), intent (in) :: ew
real(8), intent (in) :: t
real(8) :: tmp
if ((eh <= (-4.7d+130)) .or. (.not. (eh <= 3.8d+121))) then
tmp = abs((eh * (t * sin(atan((eh * (-t / ew)))))))
else
tmp = abs((ew * cos(t)))
end if
code = tmp
end function
public static double code(double eh, double ew, double t) {
double tmp;
if ((eh <= -4.7e+130) || !(eh <= 3.8e+121)) {
tmp = Math.abs((eh * (t * Math.sin(Math.atan((eh * (-t / ew)))))));
} else {
tmp = Math.abs((ew * Math.cos(t)));
}
return tmp;
}
def code(eh, ew, t): tmp = 0 if (eh <= -4.7e+130) or not (eh <= 3.8e+121): tmp = math.fabs((eh * (t * math.sin(math.atan((eh * (-t / ew))))))) else: tmp = math.fabs((ew * math.cos(t))) return tmp
function code(eh, ew, t) tmp = 0.0 if ((eh <= -4.7e+130) || !(eh <= 3.8e+121)) tmp = abs(Float64(eh * Float64(t * sin(atan(Float64(eh * Float64(Float64(-t) / ew))))))); else tmp = abs(Float64(ew * cos(t))); end return tmp end
function tmp_2 = code(eh, ew, t) tmp = 0.0; if ((eh <= -4.7e+130) || ~((eh <= 3.8e+121))) tmp = abs((eh * (t * sin(atan((eh * (-t / ew))))))); else tmp = abs((ew * cos(t))); end tmp_2 = tmp; end
code[eh_, ew_, t_] := If[Or[LessEqual[eh, -4.7e+130], N[Not[LessEqual[eh, 3.8e+121]], $MachinePrecision]], N[Abs[N[(eh * N[(t * N[Sin[N[ArcTan[N[(eh * N[((-t) / ew), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Abs[N[(ew * N[Cos[t], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;eh \leq -4.7 \cdot 10^{+130} \lor \neg \left(eh \leq 3.8 \cdot 10^{+121}\right):\\
\;\;\;\;\left|eh \cdot \left(t \cdot \sin \tan^{-1} \left(eh \cdot \frac{-t}{ew}\right)\right)\right|\\
\mathbf{else}:\\
\;\;\;\;\left|ew \cdot \cos t\right|\\
\end{array}
\end{array}
if eh < -4.70000000000000045e130 or 3.8e121 < eh Initial program 99.8%
Taylor expanded in ew around inf 78.3%
+-commutative78.3%
mul-1-neg78.3%
unsub-neg78.3%
Simplified78.1%
Taylor expanded in ew around 0 82.2%
mul-1-neg82.2%
associate-*r*82.2%
distribute-lft-neg-in82.2%
mul-1-neg82.2%
associate-*r/82.1%
distribute-lft-neg-out82.1%
*-commutative82.1%
distribute-lft-neg-out82.1%
associate-*r/82.2%
mul-1-neg82.2%
Simplified82.2%
Taylor expanded in t around 0 45.2%
mul-1-neg45.2%
*-commutative45.2%
distribute-rgt-neg-in45.2%
associate-*r/45.1%
neg-mul-145.1%
distribute-rgt-neg-in45.1%
distribute-neg-frac245.1%
Simplified45.1%
Taylor expanded in t around 0 45.1%
mul-1-neg45.1%
distribute-neg-frac245.1%
Simplified45.1%
if -4.70000000000000045e130 < eh < 3.8e121Initial program 99.8%
add-sqr-sqrt51.3%
pow251.3%
Applied egg-rr55.2%
Taylor expanded in ew around inf 50.4%
Taylor expanded in eh around inf 77.3%
associate-/l*77.2%
mul-1-neg77.2%
distribute-frac-neg277.2%
*-commutative77.2%
associate-*r/77.2%
Simplified77.2%
Taylor expanded in eh around 0 74.6%
Final simplification66.1%
(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%
add-sqr-sqrt50.9%
pow250.9%
Applied egg-rr61.0%
Taylor expanded in ew around inf 49.8%
Taylor expanded in eh around inf 83.3%
associate-/l*83.3%
mul-1-neg83.3%
distribute-frac-neg283.3%
*-commutative83.3%
associate-*r/83.3%
Simplified83.3%
Taylor expanded in eh around 0 59.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%
Taylor expanded in t around 0 42.2%
mul-1-neg42.2%
distribute-frac-neg42.2%
*-commutative42.2%
distribute-rgt-neg-in42.2%
mul-1-neg42.2%
associate-*r/42.2%
mul-1-neg42.2%
Simplified42.2%
Taylor expanded in t around 0 41.5%
mul-1-neg41.5%
distribute-neg-frac241.5%
*-commutative41.5%
Simplified41.5%
cos-atan40.6%
hypot-1-def40.7%
associate-/l*40.7%
Applied egg-rr40.7%
Taylor expanded in ew around inf 42.4%
herbie shell --seed 2024143
(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)))))))