
(FPCore (eh ew t) :precision binary64 (let* ((t_1 (atan (/ (* (- eh) (tan t)) ew)))) (fabs (- (* (* ew (cos t)) (cos t_1)) (* (* eh (sin t)) (sin t_1))))))
double code(double eh, double ew, double t) {
double t_1 = atan(((-eh * tan(t)) / ew));
return fabs((((ew * cos(t)) * cos(t_1)) - ((eh * sin(t)) * sin(t_1))));
}
real(8) function code(eh, ew, t)
real(8), intent (in) :: eh
real(8), intent (in) :: ew
real(8), intent (in) :: t
real(8) :: t_1
t_1 = atan(((-eh * tan(t)) / ew))
code = abs((((ew * cos(t)) * cos(t_1)) - ((eh * sin(t)) * sin(t_1))))
end function
public static double code(double eh, double ew, double t) {
double t_1 = Math.atan(((-eh * Math.tan(t)) / ew));
return Math.abs((((ew * Math.cos(t)) * Math.cos(t_1)) - ((eh * Math.sin(t)) * Math.sin(t_1))));
}
def code(eh, ew, t): t_1 = math.atan(((-eh * math.tan(t)) / ew)) return math.fabs((((ew * math.cos(t)) * math.cos(t_1)) - ((eh * math.sin(t)) * math.sin(t_1))))
function code(eh, ew, t) t_1 = atan(Float64(Float64(Float64(-eh) * tan(t)) / ew)) return abs(Float64(Float64(Float64(ew * cos(t)) * cos(t_1)) - Float64(Float64(eh * sin(t)) * sin(t_1)))) end
function tmp = code(eh, ew, t) t_1 = atan(((-eh * tan(t)) / ew)); tmp = abs((((ew * cos(t)) * cos(t_1)) - ((eh * sin(t)) * sin(t_1)))); end
code[eh_, ew_, t_] := Block[{t$95$1 = N[ArcTan[N[(N[((-eh) * N[Tan[t], $MachinePrecision]), $MachinePrecision] / ew), $MachinePrecision]], $MachinePrecision]}, N[Abs[N[(N[(N[(ew * N[Cos[t], $MachinePrecision]), $MachinePrecision] * N[Cos[t$95$1], $MachinePrecision]), $MachinePrecision] - N[(N[(eh * N[Sin[t], $MachinePrecision]), $MachinePrecision] * N[Sin[t$95$1], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\\
\left|\left(ew \cdot \cos t\right) \cdot \cos t\_1 - \left(eh \cdot \sin t\right) \cdot \sin t\_1\right|
\end{array}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 14 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (eh ew t) :precision binary64 (let* ((t_1 (atan (/ (* (- eh) (tan t)) ew)))) (fabs (- (* (* ew (cos t)) (cos t_1)) (* (* eh (sin t)) (sin t_1))))))
double code(double eh, double ew, double t) {
double t_1 = atan(((-eh * tan(t)) / ew));
return fabs((((ew * cos(t)) * cos(t_1)) - ((eh * sin(t)) * sin(t_1))));
}
real(8) function code(eh, ew, t)
real(8), intent (in) :: eh
real(8), intent (in) :: ew
real(8), intent (in) :: t
real(8) :: t_1
t_1 = atan(((-eh * tan(t)) / ew))
code = abs((((ew * cos(t)) * cos(t_1)) - ((eh * sin(t)) * sin(t_1))))
end function
public static double code(double eh, double ew, double t) {
double t_1 = Math.atan(((-eh * Math.tan(t)) / ew));
return Math.abs((((ew * Math.cos(t)) * Math.cos(t_1)) - ((eh * Math.sin(t)) * Math.sin(t_1))));
}
def code(eh, ew, t): t_1 = math.atan(((-eh * math.tan(t)) / ew)) return math.fabs((((ew * math.cos(t)) * math.cos(t_1)) - ((eh * math.sin(t)) * math.sin(t_1))))
function code(eh, ew, t) t_1 = atan(Float64(Float64(Float64(-eh) * tan(t)) / ew)) return abs(Float64(Float64(Float64(ew * cos(t)) * cos(t_1)) - Float64(Float64(eh * sin(t)) * sin(t_1)))) end
function tmp = code(eh, ew, t) t_1 = atan(((-eh * tan(t)) / ew)); tmp = abs((((ew * cos(t)) * cos(t_1)) - ((eh * sin(t)) * sin(t_1)))); end
code[eh_, ew_, t_] := Block[{t$95$1 = N[ArcTan[N[(N[((-eh) * N[Tan[t], $MachinePrecision]), $MachinePrecision] / ew), $MachinePrecision]], $MachinePrecision]}, N[Abs[N[(N[(N[(ew * N[Cos[t], $MachinePrecision]), $MachinePrecision] * N[Cos[t$95$1], $MachinePrecision]), $MachinePrecision] - N[(N[(eh * N[Sin[t], $MachinePrecision]), $MachinePrecision] * N[Sin[t$95$1], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\\
\left|\left(ew \cdot \cos t\right) \cdot \cos t\_1 - \left(eh \cdot \sin t\right) \cdot \sin t\_1\right|
\end{array}
\end{array}
(FPCore (eh ew t) :precision binary64 (let* ((t_1 (atan (* eh (/ (tan t) (- ew)))))) (fabs (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.7%
fabs-sub99.7%
sub-neg99.7%
+-commutative99.7%
associate-*l*99.7%
distribute-rgt-neg-in99.7%
fma-define99.8%
Simplified99.8%
Final simplification99.8%
(FPCore (eh ew t) :precision binary64 (let* ((t_1 (atan (* eh (/ (tan t) (- ew)))))) (fabs (- (* eh (* (sin t) (sin t_1))) (* (cos t_1) (* ew (cos t)))))))
double code(double eh, double ew, double t) {
double t_1 = atan((eh * (tan(t) / -ew)));
return fabs(((eh * (sin(t) * sin(t_1))) - (cos(t_1) * (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
real(8) :: t_1
t_1 = atan((eh * (tan(t) / -ew)))
code = abs(((eh * (sin(t) * sin(t_1))) - (cos(t_1) * (ew * cos(t)))))
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(((eh * (Math.sin(t) * Math.sin(t_1))) - (Math.cos(t_1) * (ew * Math.cos(t)))));
}
def code(eh, ew, t): t_1 = math.atan((eh * (math.tan(t) / -ew))) return math.fabs(((eh * (math.sin(t) * math.sin(t_1))) - (math.cos(t_1) * (ew * math.cos(t)))))
function code(eh, ew, t) t_1 = atan(Float64(eh * Float64(tan(t) / Float64(-ew)))) return abs(Float64(Float64(eh * Float64(sin(t) * sin(t_1))) - Float64(cos(t_1) * Float64(ew * cos(t))))) end
function tmp = code(eh, ew, t) t_1 = atan((eh * (tan(t) / -ew))); tmp = abs(((eh * (sin(t) * sin(t_1))) - (cos(t_1) * (ew * cos(t))))); 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[(N[(eh * N[(N[Sin[t], $MachinePrecision] * N[Sin[t$95$1], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[Cos[t$95$1], $MachinePrecision] * N[(ew * N[Cos[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \tan^{-1} \left(eh \cdot \frac{\tan t}{-ew}\right)\\
\left|eh \cdot \left(\sin t \cdot \sin t\_1\right) - \cos t\_1 \cdot \left(ew \cdot \cos t\right)\right|
\end{array}
\end{array}
Initial program 99.7%
sub-neg99.7%
associate-*l*99.8%
distribute-rgt-neg-in99.8%
cancel-sign-sub99.8%
associate-/l*99.8%
Simplified99.8%
Final simplification99.8%
(FPCore (eh ew t)
:precision binary64
(let* ((t_1 (* (sin (atan (* eh (/ (tan t) (- ew))))) (* eh (sin t)))))
(if (<= eh -6e+192)
(fabs t_1)
(if (<= eh 2.7e+182)
(fabs (* ew (+ (cos t) (/ t_1 ew))))
(fabs (* eh (* (sin t) (sin (atan (/ (* eh (tan t)) (- ew)))))))))))
double code(double eh, double ew, double t) {
double t_1 = sin(atan((eh * (tan(t) / -ew)))) * (eh * sin(t));
double tmp;
if (eh <= -6e+192) {
tmp = fabs(t_1);
} else if (eh <= 2.7e+182) {
tmp = fabs((ew * (cos(t) + (t_1 / ew))));
} else {
tmp = fabs((eh * (sin(t) * sin(atan(((eh * tan(t)) / -ew))))));
}
return tmp;
}
real(8) function code(eh, ew, t)
real(8), intent (in) :: eh
real(8), intent (in) :: ew
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = sin(atan((eh * (tan(t) / -ew)))) * (eh * sin(t))
if (eh <= (-6d+192)) then
tmp = abs(t_1)
else if (eh <= 2.7d+182) then
tmp = abs((ew * (cos(t) + (t_1 / ew))))
else
tmp = abs((eh * (sin(t) * sin(atan(((eh * tan(t)) / -ew))))))
end if
code = tmp
end function
public static double code(double eh, double ew, double t) {
double t_1 = Math.sin(Math.atan((eh * (Math.tan(t) / -ew)))) * (eh * Math.sin(t));
double tmp;
if (eh <= -6e+192) {
tmp = Math.abs(t_1);
} else if (eh <= 2.7e+182) {
tmp = Math.abs((ew * (Math.cos(t) + (t_1 / ew))));
} else {
tmp = Math.abs((eh * (Math.sin(t) * Math.sin(Math.atan(((eh * Math.tan(t)) / -ew))))));
}
return tmp;
}
def code(eh, ew, t): t_1 = math.sin(math.atan((eh * (math.tan(t) / -ew)))) * (eh * math.sin(t)) tmp = 0 if eh <= -6e+192: tmp = math.fabs(t_1) elif eh <= 2.7e+182: tmp = math.fabs((ew * (math.cos(t) + (t_1 / ew)))) else: tmp = math.fabs((eh * (math.sin(t) * math.sin(math.atan(((eh * math.tan(t)) / -ew)))))) return tmp
function code(eh, ew, t) t_1 = Float64(sin(atan(Float64(eh * Float64(tan(t) / Float64(-ew))))) * Float64(eh * sin(t))) tmp = 0.0 if (eh <= -6e+192) tmp = abs(t_1); elseif (eh <= 2.7e+182) tmp = abs(Float64(ew * Float64(cos(t) + Float64(t_1 / ew)))); else tmp = abs(Float64(eh * Float64(sin(t) * sin(atan(Float64(Float64(eh * tan(t)) / Float64(-ew))))))); end return tmp end
function tmp_2 = code(eh, ew, t) t_1 = sin(atan((eh * (tan(t) / -ew)))) * (eh * sin(t)); tmp = 0.0; if (eh <= -6e+192) tmp = abs(t_1); elseif (eh <= 2.7e+182) tmp = abs((ew * (cos(t) + (t_1 / ew)))); else tmp = abs((eh * (sin(t) * sin(atan(((eh * tan(t)) / -ew)))))); end tmp_2 = tmp; end
code[eh_, ew_, t_] := Block[{t$95$1 = N[(N[Sin[N[ArcTan[N[(eh * N[(N[Tan[t], $MachinePrecision] / (-ew)), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * N[(eh * N[Sin[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[eh, -6e+192], N[Abs[t$95$1], $MachinePrecision], If[LessEqual[eh, 2.7e+182], N[Abs[N[(ew * N[(N[Cos[t], $MachinePrecision] + N[(t$95$1 / ew), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Abs[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]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \sin \tan^{-1} \left(eh \cdot \frac{\tan t}{-ew}\right) \cdot \left(eh \cdot \sin t\right)\\
\mathbf{if}\;eh \leq -6 \cdot 10^{+192}:\\
\;\;\;\;\left|t\_1\right|\\
\mathbf{elif}\;eh \leq 2.7 \cdot 10^{+182}:\\
\;\;\;\;\left|ew \cdot \left(\cos t + \frac{t\_1}{ew}\right)\right|\\
\mathbf{else}:\\
\;\;\;\;\left|eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\frac{eh \cdot \tan t}{-ew}\right)\right)\right|\\
\end{array}
\end{array}
if eh < -6e192Initial 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 82.1%
associate-*r*82.2%
associate-*r/82.1%
neg-mul-182.1%
distribute-lft-neg-in82.1%
Simplified82.1%
if -6e192 < eh < 2.7000000000000003e182Initial 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%
*-commutative99.8%
add-sqr-sqrt21.9%
sqrt-unprod99.6%
sqr-neg99.6%
sqrt-unprod77.5%
add-sqr-sqrt99.5%
log1p-expm1-u99.5%
cos-atan99.5%
un-div-inv99.5%
hypot-1-def99.5%
add-sqr-sqrt54.2%
Applied egg-rr99.5%
Taylor expanded in ew around inf 98.2%
associate-*r*98.2%
mul-1-neg98.2%
associate-*r/98.2%
distribute-lft-neg-in98.2%
Simplified98.2%
if 2.7000000000000003e182 < eh Initial program 99.8%
fabs-sub99.8%
sub-neg99.8%
+-commutative99.8%
associate-*l*99.8%
distribute-rgt-neg-in99.8%
fma-define99.8%
Simplified99.8%
Taylor expanded in ew around 0 88.1%
Final simplification95.5%
(FPCore (eh ew t)
:precision binary64
(let* ((t_1 (fabs (* ew (cos t)))))
(if (<= ew -8.2e-77)
t_1
(if (<= ew 8e-97)
(fabs (* eh (* (sin t) (sin (atan (/ (* eh (tan t)) (- ew)))))))
(if (<= ew 2.1e+138)
(*
ew
(+
(cos t)
(* eh (/ (* (sin t) (sin (atan (* eh (/ (tan t) ew))))) ew))))
t_1)))))
double code(double eh, double ew, double t) {
double t_1 = fabs((ew * cos(t)));
double tmp;
if (ew <= -8.2e-77) {
tmp = t_1;
} else if (ew <= 8e-97) {
tmp = fabs((eh * (sin(t) * sin(atan(((eh * tan(t)) / -ew))))));
} else if (ew <= 2.1e+138) {
tmp = ew * (cos(t) + (eh * ((sin(t) * sin(atan((eh * (tan(t) / 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 <= (-8.2d-77)) then
tmp = t_1
else if (ew <= 8d-97) then
tmp = abs((eh * (sin(t) * sin(atan(((eh * tan(t)) / -ew))))))
else if (ew <= 2.1d+138) then
tmp = ew * (cos(t) + (eh * ((sin(t) * sin(atan((eh * (tan(t) / 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 <= -8.2e-77) {
tmp = t_1;
} else if (ew <= 8e-97) {
tmp = Math.abs((eh * (Math.sin(t) * Math.sin(Math.atan(((eh * Math.tan(t)) / -ew))))));
} else if (ew <= 2.1e+138) {
tmp = ew * (Math.cos(t) + (eh * ((Math.sin(t) * Math.sin(Math.atan((eh * (Math.tan(t) / 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 <= -8.2e-77: tmp = t_1 elif ew <= 8e-97: tmp = math.fabs((eh * (math.sin(t) * math.sin(math.atan(((eh * math.tan(t)) / -ew)))))) elif ew <= 2.1e+138: tmp = ew * (math.cos(t) + (eh * ((math.sin(t) * math.sin(math.atan((eh * (math.tan(t) / 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 <= -8.2e-77) tmp = t_1; elseif (ew <= 8e-97) tmp = abs(Float64(eh * Float64(sin(t) * sin(atan(Float64(Float64(eh * tan(t)) / Float64(-ew))))))); elseif (ew <= 2.1e+138) tmp = Float64(ew * Float64(cos(t) + Float64(eh * Float64(Float64(sin(t) * sin(atan(Float64(eh * Float64(tan(t) / 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 <= -8.2e-77) tmp = t_1; elseif (ew <= 8e-97) tmp = abs((eh * (sin(t) * sin(atan(((eh * tan(t)) / -ew)))))); elseif (ew <= 2.1e+138) tmp = ew * (cos(t) + (eh * ((sin(t) * sin(atan((eh * (tan(t) / 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, -8.2e-77], t$95$1, If[LessEqual[ew, 8e-97], N[Abs[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], If[LessEqual[ew, 2.1e+138], N[(ew * N[(N[Cos[t], $MachinePrecision] + N[(eh * N[(N[(N[Sin[t], $MachinePrecision] * N[Sin[N[ArcTan[N[(eh * N[(N[Tan[t], $MachinePrecision] / ew), $MachinePrecision]), $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 -8.2 \cdot 10^{-77}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;ew \leq 8 \cdot 10^{-97}:\\
\;\;\;\;\left|eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\frac{eh \cdot \tan t}{-ew}\right)\right)\right|\\
\mathbf{elif}\;ew \leq 2.1 \cdot 10^{+138}:\\
\;\;\;\;ew \cdot \left(\cos t + eh \cdot \frac{\sin t \cdot \sin \tan^{-1} \left(eh \cdot \frac{\tan t}{ew}\right)}{ew}\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if ew < -8.19999999999999925e-77 or 2.10000000000000007e138 < 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%
*-commutative99.8%
add-sqr-sqrt22.4%
sqrt-unprod99.8%
sqr-neg99.8%
sqrt-unprod77.1%
add-sqr-sqrt99.8%
log1p-expm1-u99.7%
cos-atan99.7%
un-div-inv99.7%
hypot-1-def99.7%
add-sqr-sqrt59.3%
Applied egg-rr99.7%
Taylor expanded in ew around inf 86.7%
if -8.19999999999999925e-77 < ew < 8.00000000000000029e-97Initial program 99.8%
fabs-sub99.8%
sub-neg99.8%
+-commutative99.8%
associate-*l*99.8%
distribute-rgt-neg-in99.8%
fma-define99.8%
Simplified99.8%
Taylor expanded in ew around 0 75.7%
if 8.00000000000000029e-97 < ew < 2.10000000000000007e138Initial program 99.7%
sub-neg99.7%
associate-*l*99.7%
distribute-rgt-neg-in99.7%
cancel-sign-sub99.7%
associate-/l*99.7%
Simplified99.7%
Applied egg-rr79.2%
associate-*r/79.3%
fma-undefine79.3%
associate--r+79.3%
Simplified79.3%
*-commutative79.3%
add-cbrt-cube71.2%
add-cbrt-cube49.3%
cbrt-unprod49.4%
pow349.4%
pow349.4%
Applied egg-rr49.4%
Taylor expanded in ew around inf 76.8%
associate-/l*76.7%
associate-*r/76.7%
Simplified76.7%
Final simplification80.4%
(FPCore (eh ew t)
:precision binary64
(let* ((t_1 (sin (atan (* eh (/ (tan t) (- ew))))))
(t_2 (fabs (* t_1 (* eh (sin t))))))
(if (<= t -6.2e+240)
t_2
(if (<= t -0.0016)
(fabs (* ew (cos t)))
(if (<= t 0.01) (fabs (+ ew (* t_1 (* eh t)))) t_2)))))
double code(double eh, double ew, double t) {
double t_1 = sin(atan((eh * (tan(t) / -ew))));
double t_2 = fabs((t_1 * (eh * sin(t))));
double tmp;
if (t <= -6.2e+240) {
tmp = t_2;
} else if (t <= -0.0016) {
tmp = fabs((ew * cos(t)));
} else if (t <= 0.01) {
tmp = fabs((ew + (t_1 * (eh * t))));
} else {
tmp = t_2;
}
return tmp;
}
real(8) function code(eh, ew, t)
real(8), intent (in) :: eh
real(8), intent (in) :: ew
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = sin(atan((eh * (tan(t) / -ew))))
t_2 = abs((t_1 * (eh * sin(t))))
if (t <= (-6.2d+240)) then
tmp = t_2
else if (t <= (-0.0016d0)) then
tmp = abs((ew * cos(t)))
else if (t <= 0.01d0) then
tmp = abs((ew + (t_1 * (eh * t))))
else
tmp = t_2
end if
code = tmp
end function
public static double code(double eh, double ew, double t) {
double t_1 = Math.sin(Math.atan((eh * (Math.tan(t) / -ew))));
double t_2 = Math.abs((t_1 * (eh * Math.sin(t))));
double tmp;
if (t <= -6.2e+240) {
tmp = t_2;
} else if (t <= -0.0016) {
tmp = Math.abs((ew * Math.cos(t)));
} else if (t <= 0.01) {
tmp = Math.abs((ew + (t_1 * (eh * t))));
} else {
tmp = t_2;
}
return tmp;
}
def code(eh, ew, t): t_1 = math.sin(math.atan((eh * (math.tan(t) / -ew)))) t_2 = math.fabs((t_1 * (eh * math.sin(t)))) tmp = 0 if t <= -6.2e+240: tmp = t_2 elif t <= -0.0016: tmp = math.fabs((ew * math.cos(t))) elif t <= 0.01: tmp = math.fabs((ew + (t_1 * (eh * t)))) else: tmp = t_2 return tmp
function code(eh, ew, t) t_1 = sin(atan(Float64(eh * Float64(tan(t) / Float64(-ew))))) t_2 = abs(Float64(t_1 * Float64(eh * sin(t)))) tmp = 0.0 if (t <= -6.2e+240) tmp = t_2; elseif (t <= -0.0016) tmp = abs(Float64(ew * cos(t))); elseif (t <= 0.01) tmp = abs(Float64(ew + Float64(t_1 * Float64(eh * t)))); else tmp = t_2; end return tmp end
function tmp_2 = code(eh, ew, t) t_1 = sin(atan((eh * (tan(t) / -ew)))); t_2 = abs((t_1 * (eh * sin(t)))); tmp = 0.0; if (t <= -6.2e+240) tmp = t_2; elseif (t <= -0.0016) tmp = abs((ew * cos(t))); elseif (t <= 0.01) tmp = abs((ew + (t_1 * (eh * t)))); else tmp = t_2; end tmp_2 = tmp; end
code[eh_, ew_, t_] := Block[{t$95$1 = N[Sin[N[ArcTan[N[(eh * N[(N[Tan[t], $MachinePrecision] / (-ew)), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Abs[N[(t$95$1 * N[(eh * N[Sin[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t, -6.2e+240], t$95$2, If[LessEqual[t, -0.0016], N[Abs[N[(ew * N[Cos[t], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[t, 0.01], N[Abs[N[(ew + N[(t$95$1 * N[(eh * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], t$95$2]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \sin \tan^{-1} \left(eh \cdot \frac{\tan t}{-ew}\right)\\
t_2 := \left|t\_1 \cdot \left(eh \cdot \sin t\right)\right|\\
\mathbf{if}\;t \leq -6.2 \cdot 10^{+240}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t \leq -0.0016:\\
\;\;\;\;\left|ew \cdot \cos t\right|\\
\mathbf{elif}\;t \leq 0.01:\\
\;\;\;\;\left|ew + t\_1 \cdot \left(eh \cdot t\right)\right|\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if t < -6.2e240 or 0.0100000000000000002 < t Initial program 99.4%
fabs-sub99.4%
sub-neg99.4%
+-commutative99.4%
associate-*l*99.4%
distribute-rgt-neg-in99.4%
fma-define99.4%
Simplified99.4%
Taylor expanded in ew around 0 59.4%
associate-*r*59.4%
associate-*r/59.4%
neg-mul-159.4%
distribute-lft-neg-in59.4%
Simplified59.4%
if -6.2e240 < t < -0.00160000000000000008Initial 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%
*-commutative99.8%
add-sqr-sqrt36.0%
sqrt-unprod99.6%
sqr-neg99.6%
sqrt-unprod63.4%
add-sqr-sqrt99.3%
log1p-expm1-u99.2%
cos-atan99.2%
un-div-inv99.2%
hypot-1-def99.2%
add-sqr-sqrt52.8%
Applied egg-rr99.2%
Taylor expanded in ew around inf 69.6%
if -0.00160000000000000008 < t < 0.0100000000000000002Initial 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%
*-commutative100.0%
add-sqr-sqrt0.0%
sqrt-unprod100.0%
sqr-neg100.0%
sqrt-unprod100.0%
add-sqr-sqrt100.0%
log1p-expm1-u100.0%
cos-atan100.0%
un-div-inv100.0%
hypot-1-def100.0%
add-sqr-sqrt52.8%
Applied egg-rr100.0%
Taylor expanded in t around 0 98.4%
associate-*r*98.4%
mul-1-neg98.4%
associate-*r/98.4%
distribute-lft-neg-in98.4%
Simplified98.4%
Final simplification80.0%
(FPCore (eh ew t)
:precision binary64
(if (<= t -2e+251)
(* eh (* (sin t) (sin (atan (/ (* eh (tan t)) ew)))))
(if (or (<= t -0.0016) (not (<= t 0.00125)))
(fabs (* ew (cos t)))
(fabs (+ ew (* (sin (atan (* eh (/ (tan t) (- ew))))) (* eh t)))))))
double code(double eh, double ew, double t) {
double tmp;
if (t <= -2e+251) {
tmp = eh * (sin(t) * sin(atan(((eh * tan(t)) / ew))));
} else if ((t <= -0.0016) || !(t <= 0.00125)) {
tmp = fabs((ew * cos(t)));
} else {
tmp = fabs((ew + (sin(atan((eh * (tan(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 (t <= (-2d+251)) then
tmp = eh * (sin(t) * sin(atan(((eh * tan(t)) / ew))))
else if ((t <= (-0.0016d0)) .or. (.not. (t <= 0.00125d0))) then
tmp = abs((ew * cos(t)))
else
tmp = abs((ew + (sin(atan((eh * (tan(t) / -ew)))) * (eh * t))))
end if
code = tmp
end function
public static double code(double eh, double ew, double t) {
double tmp;
if (t <= -2e+251) {
tmp = eh * (Math.sin(t) * Math.sin(Math.atan(((eh * Math.tan(t)) / ew))));
} else if ((t <= -0.0016) || !(t <= 0.00125)) {
tmp = Math.abs((ew * Math.cos(t)));
} else {
tmp = Math.abs((ew + (Math.sin(Math.atan((eh * (Math.tan(t) / -ew)))) * (eh * t))));
}
return tmp;
}
def code(eh, ew, t): tmp = 0 if t <= -2e+251: tmp = eh * (math.sin(t) * math.sin(math.atan(((eh * math.tan(t)) / ew)))) elif (t <= -0.0016) or not (t <= 0.00125): tmp = math.fabs((ew * math.cos(t))) else: tmp = math.fabs((ew + (math.sin(math.atan((eh * (math.tan(t) / -ew)))) * (eh * t)))) return tmp
function code(eh, ew, t) tmp = 0.0 if (t <= -2e+251) tmp = Float64(eh * Float64(sin(t) * sin(atan(Float64(Float64(eh * tan(t)) / ew))))); elseif ((t <= -0.0016) || !(t <= 0.00125)) tmp = abs(Float64(ew * cos(t))); else tmp = abs(Float64(ew + Float64(sin(atan(Float64(eh * Float64(tan(t) / Float64(-ew))))) * Float64(eh * t)))); end return tmp end
function tmp_2 = code(eh, ew, t) tmp = 0.0; if (t <= -2e+251) tmp = eh * (sin(t) * sin(atan(((eh * tan(t)) / ew)))); elseif ((t <= -0.0016) || ~((t <= 0.00125))) tmp = abs((ew * cos(t))); else tmp = abs((ew + (sin(atan((eh * (tan(t) / -ew)))) * (eh * t)))); end tmp_2 = tmp; end
code[eh_, ew_, t_] := If[LessEqual[t, -2e+251], 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], If[Or[LessEqual[t, -0.0016], N[Not[LessEqual[t, 0.00125]], $MachinePrecision]], N[Abs[N[(ew * N[Cos[t], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Abs[N[(ew + N[(N[Sin[N[ArcTan[N[(eh * N[(N[Tan[t], $MachinePrecision] / (-ew)), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * N[(eh * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2 \cdot 10^{+251}:\\
\;\;\;\;eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\frac{eh \cdot \tan t}{ew}\right)\right)\\
\mathbf{elif}\;t \leq -0.0016 \lor \neg \left(t \leq 0.00125\right):\\
\;\;\;\;\left|ew \cdot \cos t\right|\\
\mathbf{else}:\\
\;\;\;\;\left|ew + \sin \tan^{-1} \left(eh \cdot \frac{\tan t}{-ew}\right) \cdot \left(eh \cdot t\right)\right|\\
\end{array}
\end{array}
if t < -2.0000000000000001e251Initial program 99.4%
sub-neg99.4%
associate-*l*99.4%
distribute-rgt-neg-in99.4%
cancel-sign-sub99.4%
associate-/l*99.4%
Simplified99.4%
Applied egg-rr80.0%
Taylor expanded in eh around inf 63.7%
if -2.0000000000000001e251 < t < -0.00160000000000000008 or 0.00125000000000000003 < t Initial program 99.5%
fabs-sub99.5%
sub-neg99.5%
+-commutative99.5%
associate-*l*99.5%
distribute-rgt-neg-in99.5%
fma-define99.6%
Simplified99.6%
*-commutative99.6%
add-sqr-sqrt41.1%
sqrt-unprod99.2%
sqr-neg99.2%
sqrt-unprod57.8%
add-sqr-sqrt99.1%
log1p-expm1-u99.1%
cos-atan99.1%
un-div-inv99.1%
hypot-1-def99.1%
add-sqr-sqrt55.7%
Applied egg-rr99.1%
Taylor expanded in ew around inf 56.2%
if -0.00160000000000000008 < t < 0.00125000000000000003Initial 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%
*-commutative100.0%
add-sqr-sqrt0.0%
sqrt-unprod100.0%
sqr-neg100.0%
sqrt-unprod100.0%
add-sqr-sqrt100.0%
log1p-expm1-u100.0%
cos-atan100.0%
un-div-inv100.0%
hypot-1-def100.0%
add-sqr-sqrt52.5%
Applied egg-rr100.0%
Taylor expanded in t around 0 98.9%
associate-*r*98.9%
mul-1-neg98.9%
associate-*r/98.9%
distribute-lft-neg-in98.9%
Simplified98.9%
Final simplification76.9%
(FPCore (eh ew t)
:precision binary64
(let* ((t_1 (fabs (* ew (cos t)))))
(if (<= ew -8e-81)
t_1
(if (<= ew -7.8e-294)
(* eh (* (sin (atan (* eh (/ (tan t) ew)))) (- (sin t))))
(if (<= ew 5.2e-95)
(* 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 <= -8e-81) {
tmp = t_1;
} else if (ew <= -7.8e-294) {
tmp = eh * (sin(atan((eh * (tan(t) / ew)))) * -sin(t));
} else if (ew <= 5.2e-95) {
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 <= (-8d-81)) then
tmp = t_1
else if (ew <= (-7.8d-294)) then
tmp = eh * (sin(atan((eh * (tan(t) / ew)))) * -sin(t))
else if (ew <= 5.2d-95) 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 <= -8e-81) {
tmp = t_1;
} else if (ew <= -7.8e-294) {
tmp = eh * (Math.sin(Math.atan((eh * (Math.tan(t) / ew)))) * -Math.sin(t));
} else if (ew <= 5.2e-95) {
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 <= -8e-81: tmp = t_1 elif ew <= -7.8e-294: tmp = eh * (math.sin(math.atan((eh * (math.tan(t) / ew)))) * -math.sin(t)) elif ew <= 5.2e-95: 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 <= -8e-81) tmp = t_1; elseif (ew <= -7.8e-294) tmp = Float64(eh * Float64(sin(atan(Float64(eh * Float64(tan(t) / ew)))) * Float64(-sin(t)))); elseif (ew <= 5.2e-95) 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 <= -8e-81) tmp = t_1; elseif (ew <= -7.8e-294) tmp = eh * (sin(atan((eh * (tan(t) / ew)))) * -sin(t)); elseif (ew <= 5.2e-95) 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, -8e-81], t$95$1, If[LessEqual[ew, -7.8e-294], N[(eh * N[(N[Sin[N[ArcTan[N[(eh * N[(N[Tan[t], $MachinePrecision] / ew), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * (-N[Sin[t], $MachinePrecision])), $MachinePrecision]), $MachinePrecision], If[LessEqual[ew, 5.2e-95], 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 -8 \cdot 10^{-81}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;ew \leq -7.8 \cdot 10^{-294}:\\
\;\;\;\;eh \cdot \left(\sin \tan^{-1} \left(eh \cdot \frac{\tan t}{ew}\right) \cdot \left(-\sin t\right)\right)\\
\mathbf{elif}\;ew \leq 5.2 \cdot 10^{-95}:\\
\;\;\;\;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 < -7.9999999999999997e-81 or 5.20000000000000001e-95 < ew Initial 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%
*-commutative99.7%
add-sqr-sqrt22.5%
sqrt-unprod99.5%
sqr-neg99.5%
sqrt-unprod76.8%
add-sqr-sqrt99.5%
log1p-expm1-u99.5%
cos-atan99.5%
un-div-inv99.5%
hypot-1-def99.5%
add-sqr-sqrt56.3%
Applied egg-rr99.5%
Taylor expanded in ew around inf 79.5%
if -7.9999999999999997e-81 < ew < -7.8000000000000005e-294Initial program 99.8%
sub-neg99.8%
associate-*l*99.8%
distribute-rgt-neg-in99.8%
cancel-sign-sub99.8%
associate-/l*99.8%
Simplified99.8%
add-cube-cbrt98.4%
pow398.3%
associate-*r*98.3%
*-commutative98.3%
add-sqr-sqrt41.6%
sqrt-unprod98.0%
sqr-neg98.0%
sqrt-unprod56.3%
add-sqr-sqrt98.0%
Applied egg-rr98.0%
add-cube-cbrt96.9%
pow397.0%
Applied egg-rr59.9%
Taylor expanded in ew around 0 59.1%
mul-1-neg59.1%
associate-*r/59.1%
distribute-rgt-neg-in59.1%
distribute-lft-neg-in59.1%
Simplified59.1%
if -7.8000000000000005e-294 < ew < 5.20000000000000001e-95Initial program 99.7%
sub-neg99.7%
associate-*l*99.7%
distribute-rgt-neg-in99.7%
cancel-sign-sub99.7%
associate-/l*99.7%
Simplified99.7%
Applied egg-rr77.7%
Taylor expanded in eh around inf 59.6%
Final simplification71.5%
(FPCore (eh ew t) :precision binary64 (if (or (<= eh -6e+176) (not (<= eh 1.5e+200))) (* 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 <= -6e+176) || !(eh <= 1.5e+200)) {
tmp = 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 <= (-6d+176)) .or. (.not. (eh <= 1.5d+200))) then
tmp = 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 <= -6e+176) || !(eh <= 1.5e+200)) {
tmp = 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 <= -6e+176) or not (eh <= 1.5e+200): tmp = 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 <= -6e+176) || !(eh <= 1.5e+200)) tmp = Float64(eh * Float64(sin(t) * sin(atan(Float64(Float64(eh * 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 <= -6e+176) || ~((eh <= 1.5e+200))) tmp = 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, -6e+176], N[Not[LessEqual[eh, 1.5e+200]], $MachinePrecision]], 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], N[Abs[N[(ew * N[Cos[t], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;eh \leq -6 \cdot 10^{+176} \lor \neg \left(eh \leq 1.5 \cdot 10^{+200}\right):\\
\;\;\;\;eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\frac{eh \cdot \tan t}{ew}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left|ew \cdot \cos t\right|\\
\end{array}
\end{array}
if eh < -6e176 or 1.49999999999999995e200 < eh Initial program 99.7%
sub-neg99.7%
associate-*l*99.7%
distribute-rgt-neg-in99.7%
cancel-sign-sub99.7%
associate-/l*99.7%
Simplified99.7%
Applied egg-rr67.0%
Taylor expanded in eh around inf 59.8%
if -6e176 < eh < 1.49999999999999995e200Initial 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%
*-commutative99.8%
add-sqr-sqrt21.6%
sqrt-unprod99.6%
sqr-neg99.6%
sqrt-unprod77.8%
add-sqr-sqrt99.5%
log1p-expm1-u99.5%
cos-atan99.5%
un-div-inv99.5%
hypot-1-def99.5%
add-sqr-sqrt52.3%
Applied egg-rr99.5%
Taylor expanded in ew around inf 69.8%
Final simplification67.7%
(FPCore (eh ew t) :precision binary64 (if (or (<= ew -2.2e-306) (not (<= ew 6.5e-89))) (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 <= -2.2e-306) || !(ew <= 6.5e-89)) {
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 <= (-2.2d-306)) .or. (.not. (ew <= 6.5d-89))) 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 <= -2.2e-306) || !(ew <= 6.5e-89)) {
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 <= -2.2e-306) or not (ew <= 6.5e-89): 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 <= -2.2e-306) || !(ew <= 6.5e-89)) 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 <= -2.2e-306) || ~((ew <= 6.5e-89))) 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, -2.2e-306], N[Not[LessEqual[ew, 6.5e-89]], $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 -2.2 \cdot 10^{-306} \lor \neg \left(ew \leq 6.5 \cdot 10^{-89}\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 < -2.20000000000000016e-306 or 6.50000000000000034e-89 < ew Initial program 99.7%
fabs-sub99.7%
sub-neg99.7%
+-commutative99.7%
associate-*l*99.7%
distribute-rgt-neg-in99.7%
fma-define99.8%
Simplified99.8%
*-commutative99.8%
add-sqr-sqrt21.7%
sqrt-unprod99.6%
sqr-neg99.6%
sqrt-unprod77.7%
add-sqr-sqrt99.5%
log1p-expm1-u99.5%
cos-atan99.5%
un-div-inv99.5%
hypot-1-def99.5%
add-sqr-sqrt53.4%
Applied egg-rr99.5%
Taylor expanded in ew around inf 69.3%
if -2.20000000000000016e-306 < ew < 6.50000000000000034e-89Initial program 99.8%
sub-neg99.8%
associate-*l*99.8%
distribute-rgt-neg-in99.8%
cancel-sign-sub99.8%
associate-/l*99.8%
Simplified99.8%
Applied egg-rr78.6%
Taylor expanded in t around 0 50.1%
Final simplification64.8%
(FPCore (eh ew t) :precision binary64 (if (<= eh 1.65e+245) (fabs (* ew (cos t))) (* eh (* t (sin (atan (/ (* eh (tan t)) ew)))))))
double code(double eh, double ew, double t) {
double tmp;
if (eh <= 1.65e+245) {
tmp = fabs((ew * cos(t)));
} else {
tmp = 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 (eh <= 1.65d+245) then
tmp = abs((ew * cos(t)))
else
tmp = 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 (eh <= 1.65e+245) {
tmp = Math.abs((ew * Math.cos(t)));
} else {
tmp = eh * (t * Math.sin(Math.atan(((eh * Math.tan(t)) / ew))));
}
return tmp;
}
def code(eh, ew, t): tmp = 0 if eh <= 1.65e+245: tmp = math.fabs((ew * math.cos(t))) else: tmp = eh * (t * math.sin(math.atan(((eh * math.tan(t)) / ew)))) return tmp
function code(eh, ew, t) tmp = 0.0 if (eh <= 1.65e+245) tmp = abs(Float64(ew * cos(t))); else tmp = 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 (eh <= 1.65e+245) tmp = abs((ew * cos(t))); else tmp = eh * (t * sin(atan(((eh * tan(t)) / ew)))); end tmp_2 = tmp; end
code[eh_, ew_, t_] := If[LessEqual[eh, 1.65e+245], N[Abs[N[(ew * N[Cos[t], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(eh * N[(t * N[Sin[N[ArcTan[N[(N[(eh * N[Tan[t], $MachinePrecision]), $MachinePrecision] / ew), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;eh \leq 1.65 \cdot 10^{+245}:\\
\;\;\;\;\left|ew \cdot \cos t\right|\\
\mathbf{else}:\\
\;\;\;\;eh \cdot \left(t \cdot \sin \tan^{-1} \left(\frac{eh \cdot \tan t}{ew}\right)\right)\\
\end{array}
\end{array}
if eh < 1.65000000000000005e245Initial program 99.7%
fabs-sub99.7%
sub-neg99.7%
+-commutative99.7%
associate-*l*99.7%
distribute-rgt-neg-in99.7%
fma-define99.8%
Simplified99.8%
*-commutative99.8%
add-sqr-sqrt22.3%
sqrt-unprod99.6%
sqr-neg99.6%
sqrt-unprod77.2%
add-sqr-sqrt99.5%
log1p-expm1-u99.5%
cos-atan99.5%
un-div-inv99.5%
hypot-1-def99.5%
add-sqr-sqrt56.1%
Applied egg-rr99.5%
Taylor expanded in ew around inf 61.7%
if 1.65000000000000005e245 < eh Initial program 99.9%
sub-neg99.9%
associate-*l*99.9%
distribute-rgt-neg-in99.9%
cancel-sign-sub99.9%
associate-/l*99.9%
Simplified99.9%
Applied egg-rr71.1%
Taylor expanded in eh around inf 71.1%
Taylor expanded in t around 0 57.0%
(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.7%
fabs-sub99.7%
sub-neg99.7%
+-commutative99.7%
associate-*l*99.7%
distribute-rgt-neg-in99.7%
fma-define99.8%
Simplified99.8%
*-commutative99.8%
add-sqr-sqrt21.7%
sqrt-unprod99.6%
sqr-neg99.6%
sqrt-unprod77.7%
add-sqr-sqrt99.5%
log1p-expm1-u99.5%
cos-atan99.5%
un-div-inv99.5%
hypot-1-def99.5%
add-sqr-sqrt53.7%
Applied egg-rr99.5%
Taylor expanded in ew around inf 59.3%
(FPCore (eh ew t) :precision binary64 (if (or (<= t -0.003) (not (<= t 3.8e+33))) (* ew (cos t)) (fabs ew)))
double code(double eh, double ew, double t) {
double tmp;
if ((t <= -0.003) || !(t <= 3.8e+33)) {
tmp = ew * cos(t);
} 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.003d0)) .or. (.not. (t <= 3.8d+33))) then
tmp = ew * cos(t)
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.003) || !(t <= 3.8e+33)) {
tmp = ew * Math.cos(t);
} else {
tmp = Math.abs(ew);
}
return tmp;
}
def code(eh, ew, t): tmp = 0 if (t <= -0.003) or not (t <= 3.8e+33): tmp = ew * math.cos(t) else: tmp = math.fabs(ew) return tmp
function code(eh, ew, t) tmp = 0.0 if ((t <= -0.003) || !(t <= 3.8e+33)) tmp = Float64(ew * cos(t)); else tmp = abs(ew); end return tmp end
function tmp_2 = code(eh, ew, t) tmp = 0.0; if ((t <= -0.003) || ~((t <= 3.8e+33))) tmp = ew * cos(t); else tmp = abs(ew); end tmp_2 = tmp; end
code[eh_, ew_, t_] := If[Or[LessEqual[t, -0.003], N[Not[LessEqual[t, 3.8e+33]], $MachinePrecision]], N[(ew * N[Cos[t], $MachinePrecision]), $MachinePrecision], N[Abs[ew], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -0.003 \lor \neg \left(t \leq 3.8 \cdot 10^{+33}\right):\\
\;\;\;\;ew \cdot \cos t\\
\mathbf{else}:\\
\;\;\;\;\left|ew\right|\\
\end{array}
\end{array}
if t < -0.0030000000000000001 or 3.80000000000000002e33 < t Initial program 99.5%
sub-neg99.5%
associate-*l*99.5%
distribute-rgt-neg-in99.5%
cancel-sign-sub99.5%
associate-/l*99.5%
Simplified99.5%
Applied egg-rr55.9%
Taylor expanded in eh around 0 31.5%
rem-cube-cbrt32.0%
*-commutative32.0%
Applied egg-rr32.0%
if -0.0030000000000000001 < t < 3.80000000000000002e33Initial 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%
*-commutative100.0%
add-sqr-sqrt3.0%
sqrt-unprod100.0%
sqr-neg100.0%
sqrt-unprod96.9%
add-sqr-sqrt100.0%
log1p-expm1-u99.9%
cos-atan99.9%
un-div-inv99.9%
hypot-1-def99.9%
add-sqr-sqrt53.4%
Applied egg-rr99.9%
Taylor expanded in t around 0 62.1%
Final simplification47.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.7%
fabs-sub99.7%
sub-neg99.7%
+-commutative99.7%
associate-*l*99.7%
distribute-rgt-neg-in99.7%
fma-define99.8%
Simplified99.8%
*-commutative99.8%
add-sqr-sqrt21.7%
sqrt-unprod99.6%
sqr-neg99.6%
sqrt-unprod77.7%
add-sqr-sqrt99.5%
log1p-expm1-u99.5%
cos-atan99.5%
un-div-inv99.5%
hypot-1-def99.5%
add-sqr-sqrt53.7%
Applied egg-rr99.5%
Taylor expanded in t around 0 38.4%
(FPCore (eh ew t) :precision binary64 ew)
double code(double eh, double ew, double t) {
return ew;
}
real(8) function code(eh, ew, t)
real(8), intent (in) :: eh
real(8), intent (in) :: ew
real(8), intent (in) :: t
code = ew
end function
public static double code(double eh, double ew, double t) {
return ew;
}
def code(eh, ew, t): return ew
function code(eh, ew, t) return ew end
function tmp = code(eh, ew, t) tmp = ew; end
code[eh_, ew_, t_] := ew
\begin{array}{l}
\\
ew
\end{array}
Initial program 99.7%
sub-neg99.7%
associate-*l*99.8%
distribute-rgt-neg-in99.8%
cancel-sign-sub99.8%
associate-/l*99.8%
Simplified99.8%
Applied egg-rr54.0%
Taylor expanded in t around 0 19.6%
rem-cube-cbrt19.9%
*-un-lft-identity19.9%
Applied egg-rr19.9%
Final simplification19.9%
herbie shell --seed 2024137
(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)))))))