
(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 (* eh (tan t))))
(fabs
(-
(* (* ew (cos t)) (cos (atan (/ t_1 ew))))
(* (* eh (sin t)) (sin (atan (/ t_1 (- ew)))))))))
double code(double eh, double ew, double t) {
double t_1 = eh * tan(t);
return fabs((((ew * cos(t)) * cos(atan((t_1 / ew)))) - ((eh * sin(t)) * sin(atan((t_1 / -ew))))));
}
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 = eh * tan(t)
code = abs((((ew * cos(t)) * cos(atan((t_1 / ew)))) - ((eh * sin(t)) * sin(atan((t_1 / -ew))))))
end function
public static double code(double eh, double ew, double t) {
double t_1 = eh * Math.tan(t);
return Math.abs((((ew * Math.cos(t)) * Math.cos(Math.atan((t_1 / ew)))) - ((eh * Math.sin(t)) * Math.sin(Math.atan((t_1 / -ew))))));
}
def code(eh, ew, t): t_1 = eh * math.tan(t) return math.fabs((((ew * math.cos(t)) * math.cos(math.atan((t_1 / ew)))) - ((eh * math.sin(t)) * math.sin(math.atan((t_1 / -ew))))))
function code(eh, ew, t) t_1 = Float64(eh * tan(t)) return abs(Float64(Float64(Float64(ew * cos(t)) * cos(atan(Float64(t_1 / ew)))) - Float64(Float64(eh * sin(t)) * sin(atan(Float64(t_1 / Float64(-ew))))))) end
function tmp = code(eh, ew, t) t_1 = eh * tan(t); tmp = abs((((ew * cos(t)) * cos(atan((t_1 / ew)))) - ((eh * sin(t)) * sin(atan((t_1 / -ew)))))); end
code[eh_, ew_, t_] := Block[{t$95$1 = N[(eh * N[Tan[t], $MachinePrecision]), $MachinePrecision]}, N[Abs[N[(N[(N[(ew * N[Cos[t], $MachinePrecision]), $MachinePrecision] * N[Cos[N[ArcTan[N[(t$95$1 / ew), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - N[(N[(eh * N[Sin[t], $MachinePrecision]), $MachinePrecision] * N[Sin[N[ArcTan[N[(t$95$1 / (-ew)), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := eh \cdot \tan t\\
\left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{t\_1}{ew}\right) - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{t\_1}{-ew}\right)\right|
\end{array}
\end{array}
Initial program 99.8%
add-sqr-sqrt46.8%
sqrt-unprod93.3%
sqr-neg93.3%
sqrt-unprod53.1%
add-sqr-sqrt99.8%
pow199.8%
Applied egg-rr99.8%
unpow199.8%
Simplified99.8%
Final simplification99.8%
(FPCore (eh ew t)
:precision binary64
(let* ((t_1 (* ew (cos t))) (t_2 (atan (/ (* eh (tan t)) (- ew)))))
(if (<= (- (* t_1 (cos t_2)) (* (* eh (sin t)) (sin t_2))) -5e-272)
(fabs (- ew (* eh (* (sin t) (sin (atan (* eh (/ (tan t) (- ew)))))))))
(+ t_1 (* eh (* (sin t) (sin (atan (* (tan t) (/ eh ew))))))))))
double code(double eh, double ew, double t) {
double t_1 = ew * cos(t);
double t_2 = atan(((eh * tan(t)) / -ew));
double tmp;
if (((t_1 * cos(t_2)) - ((eh * sin(t)) * sin(t_2))) <= -5e-272) {
tmp = fabs((ew - (eh * (sin(t) * sin(atan((eh * (tan(t) / -ew))))))));
} else {
tmp = t_1 + (eh * (sin(t) * sin(atan((tan(t) * (eh / ew))))));
}
return tmp;
}
real(8) function code(eh, ew, t)
real(8), intent (in) :: eh
real(8), intent (in) :: ew
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = ew * cos(t)
t_2 = atan(((eh * tan(t)) / -ew))
if (((t_1 * cos(t_2)) - ((eh * sin(t)) * sin(t_2))) <= (-5d-272)) then
tmp = abs((ew - (eh * (sin(t) * sin(atan((eh * (tan(t) / -ew))))))))
else
tmp = t_1 + (eh * (sin(t) * sin(atan((tan(t) * (eh / ew))))))
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.atan(((eh * Math.tan(t)) / -ew));
double tmp;
if (((t_1 * Math.cos(t_2)) - ((eh * Math.sin(t)) * Math.sin(t_2))) <= -5e-272) {
tmp = Math.abs((ew - (eh * (Math.sin(t) * Math.sin(Math.atan((eh * (Math.tan(t) / -ew))))))));
} else {
tmp = t_1 + (eh * (Math.sin(t) * Math.sin(Math.atan((Math.tan(t) * (eh / ew))))));
}
return tmp;
}
def code(eh, ew, t): t_1 = ew * math.cos(t) t_2 = math.atan(((eh * math.tan(t)) / -ew)) tmp = 0 if ((t_1 * math.cos(t_2)) - ((eh * math.sin(t)) * math.sin(t_2))) <= -5e-272: tmp = math.fabs((ew - (eh * (math.sin(t) * math.sin(math.atan((eh * (math.tan(t) / -ew)))))))) else: tmp = t_1 + (eh * (math.sin(t) * math.sin(math.atan((math.tan(t) * (eh / ew)))))) return tmp
function code(eh, ew, t) t_1 = Float64(ew * cos(t)) t_2 = atan(Float64(Float64(eh * tan(t)) / Float64(-ew))) tmp = 0.0 if (Float64(Float64(t_1 * cos(t_2)) - Float64(Float64(eh * sin(t)) * sin(t_2))) <= -5e-272) tmp = abs(Float64(ew - Float64(eh * Float64(sin(t) * sin(atan(Float64(eh * Float64(tan(t) / Float64(-ew))))))))); else tmp = Float64(t_1 + Float64(eh * Float64(sin(t) * sin(atan(Float64(tan(t) * Float64(eh / ew))))))); end return tmp end
function tmp_2 = code(eh, ew, t) t_1 = ew * cos(t); t_2 = atan(((eh * tan(t)) / -ew)); tmp = 0.0; if (((t_1 * cos(t_2)) - ((eh * sin(t)) * sin(t_2))) <= -5e-272) tmp = abs((ew - (eh * (sin(t) * sin(atan((eh * (tan(t) / -ew)))))))); else tmp = t_1 + (eh * (sin(t) * sin(atan((tan(t) * (eh / ew)))))); 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[ArcTan[N[(N[(eh * N[Tan[t], $MachinePrecision]), $MachinePrecision] / (-ew)), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[(N[(t$95$1 * N[Cos[t$95$2], $MachinePrecision]), $MachinePrecision] - N[(N[(eh * N[Sin[t], $MachinePrecision]), $MachinePrecision] * N[Sin[t$95$2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], -5e-272], N[Abs[N[(ew - N[(eh * N[(N[Sin[t], $MachinePrecision] * N[Sin[N[ArcTan[N[(eh * N[(N[Tan[t], $MachinePrecision] / (-ew)), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(t$95$1 + N[(eh * N[(N[Sin[t], $MachinePrecision] * N[Sin[N[ArcTan[N[(N[Tan[t], $MachinePrecision] * N[(eh / ew), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := ew \cdot \cos t\\
t_2 := \tan^{-1} \left(\frac{eh \cdot \tan t}{-ew}\right)\\
\mathbf{if}\;t\_1 \cdot \cos t\_2 - \left(eh \cdot \sin t\right) \cdot \sin t\_2 \leq -5 \cdot 10^{-272}:\\
\;\;\;\;\left|ew - eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(eh \cdot \frac{\tan t}{-ew}\right)\right)\right|\\
\mathbf{else}:\\
\;\;\;\;t\_1 + eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\tan t \cdot \frac{eh}{ew}\right)\right)\\
\end{array}
\end{array}
if (-.f64 (*.f64 (*.f64 ew (cos.f64 t)) (cos.f64 (atan.f64 (/.f64 (*.f64 (neg.f64 eh) (tan.f64 t)) ew)))) (*.f64 (*.f64 eh (sin.f64 t)) (sin.f64 (atan.f64 (/.f64 (*.f64 (neg.f64 eh) (tan.f64 t)) ew))))) < -4.99999999999999982e-272Initial program 99.8%
sub-neg99.8%
associate-*l*99.8%
distribute-rgt-neg-in99.8%
cancel-sign-sub99.8%
associate-/l*99.8%
Simplified99.8%
cos-atan99.8%
un-div-inv99.8%
hypot-1-def99.8%
associate-*r/99.8%
*-commutative99.8%
associate-/l*99.8%
add-sqr-sqrt47.8%
sqrt-unprod94.6%
sqr-neg94.6%
sqrt-unprod52.0%
add-sqr-sqrt99.8%
Applied egg-rr99.8%
Taylor expanded in t around 0 75.2%
if -4.99999999999999982e-272 < (-.f64 (*.f64 (*.f64 ew (cos.f64 t)) (cos.f64 (atan.f64 (/.f64 (*.f64 (neg.f64 eh) (tan.f64 t)) ew)))) (*.f64 (*.f64 eh (sin.f64 t)) (sin.f64 (atan.f64 (/.f64 (*.f64 (neg.f64 eh) (tan.f64 t)) ew))))) Initial program 99.8%
sub-neg99.8%
associate-*l*99.8%
distribute-rgt-neg-in99.8%
cancel-sign-sub99.8%
associate-/l*99.8%
Simplified99.8%
Applied egg-rr99.8%
Taylor expanded in ew around inf 98.2%
Final simplification85.4%
(FPCore (eh ew t) :precision binary64 (fabs (- (/ (* ew (cos t)) (hypot 1.0 (* (tan t) (/ eh ew)))) (* eh (* (sin t) (sin (atan (* eh (/ (tan t) (- ew))))))))))
double code(double eh, double ew, double t) {
return fabs((((ew * cos(t)) / hypot(1.0, (tan(t) * (eh / ew)))) - (eh * (sin(t) * sin(atan((eh * (tan(t) / -ew))))))));
}
public static double code(double eh, double ew, double t) {
return Math.abs((((ew * Math.cos(t)) / Math.hypot(1.0, (Math.tan(t) * (eh / ew)))) - (eh * (Math.sin(t) * Math.sin(Math.atan((eh * (Math.tan(t) / -ew))))))));
}
def code(eh, ew, t): return math.fabs((((ew * math.cos(t)) / math.hypot(1.0, (math.tan(t) * (eh / ew)))) - (eh * (math.sin(t) * math.sin(math.atan((eh * (math.tan(t) / -ew))))))))
function code(eh, ew, t) return abs(Float64(Float64(Float64(ew * cos(t)) / hypot(1.0, Float64(tan(t) * Float64(eh / ew)))) - Float64(eh * Float64(sin(t) * sin(atan(Float64(eh * Float64(tan(t) / Float64(-ew))))))))) end
function tmp = code(eh, ew, t) tmp = abs((((ew * cos(t)) / hypot(1.0, (tan(t) * (eh / ew)))) - (eh * (sin(t) * sin(atan((eh * (tan(t) / -ew)))))))); end
code[eh_, ew_, t_] := N[Abs[N[(N[(N[(ew * N[Cos[t], $MachinePrecision]), $MachinePrecision] / N[Sqrt[1.0 ^ 2 + N[(N[Tan[t], $MachinePrecision] * N[(eh / ew), $MachinePrecision]), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision] - N[(eh * N[(N[Sin[t], $MachinePrecision] * N[Sin[N[ArcTan[N[(eh * N[(N[Tan[t], $MachinePrecision] / (-ew)), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\left|\frac{ew \cdot \cos t}{\mathsf{hypot}\left(1, \tan t \cdot \frac{eh}{ew}\right)} - eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(eh \cdot \frac{\tan t}{-ew}\right)\right)\right|
\end{array}
Initial program 99.8%
sub-neg99.8%
associate-*l*99.8%
distribute-rgt-neg-in99.8%
cancel-sign-sub99.8%
associate-/l*99.8%
Simplified99.8%
cos-atan99.8%
un-div-inv99.8%
hypot-1-def99.8%
associate-*r/99.8%
*-commutative99.8%
associate-/l*99.8%
add-sqr-sqrt46.8%
sqrt-unprod93.0%
sqr-neg93.0%
sqrt-unprod53.0%
add-sqr-sqrt99.8%
Applied egg-rr99.8%
Final simplification99.8%
(FPCore (eh ew t) :precision binary64 (fabs (- (/ ew (/ (hypot 1.0 (* eh (/ (tan t) ew))) (cos t))) (* (* eh (sin t)) (sin (atan (/ (* eh (tan t)) (- ew))))))))
double code(double eh, double ew, double t) {
return fabs(((ew / (hypot(1.0, (eh * (tan(t) / 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(((ew / (Math.hypot(1.0, (eh * (Math.tan(t) / ew))) / Math.cos(t))) - ((eh * Math.sin(t)) * Math.sin(Math.atan(((eh * Math.tan(t)) / -ew))))));
}
def code(eh, ew, t): return math.fabs(((ew / (math.hypot(1.0, (eh * (math.tan(t) / ew))) / math.cos(t))) - ((eh * math.sin(t)) * math.sin(math.atan(((eh * math.tan(t)) / -ew))))))
function code(eh, ew, t) return abs(Float64(Float64(ew / Float64(hypot(1.0, Float64(eh * Float64(tan(t) / ew))) / cos(t))) - Float64(Float64(eh * sin(t)) * sin(atan(Float64(Float64(eh * tan(t)) / Float64(-ew))))))) end
function tmp = code(eh, ew, t) tmp = abs(((ew / (hypot(1.0, (eh * (tan(t) / ew))) / cos(t))) - ((eh * sin(t)) * sin(atan(((eh * tan(t)) / -ew)))))); end
code[eh_, ew_, t_] := N[Abs[N[(N[(ew / N[(N[Sqrt[1.0 ^ 2 + N[(eh * N[(N[Tan[t], $MachinePrecision] / ew), $MachinePrecision]), $MachinePrecision] ^ 2], $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{ew}{\frac{\mathsf{hypot}\left(1, eh \cdot \frac{\tan t}{ew}\right)}{\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-sqr-sqrt46.8%
sqrt-unprod93.3%
sqr-neg93.3%
sqrt-unprod53.1%
add-sqr-sqrt99.8%
pow199.8%
Applied egg-rr99.8%
unpow199.8%
Simplified99.8%
associate-*l*99.8%
*-commutative99.8%
associate-*r/99.8%
cos-atan99.8%
hypot-1-def99.8%
div-inv99.8%
clear-num99.8%
un-div-inv99.8%
associate-*r/99.8%
*-commutative99.8%
associate-/l*99.8%
Applied egg-rr99.8%
Final simplification99.8%
(FPCore (eh ew t) :precision binary64 (fabs (- (* ew (cos t)) (* eh (* (sin t) (sin (atan (* eh (/ (tan t) (- ew))))))))))
double code(double eh, double ew, double t) {
return fabs(((ew * cos(t)) - (eh * (sin(t) * sin(atan((eh * (tan(t) / -ew))))))));
}
real(8) function code(eh, ew, t)
real(8), intent (in) :: eh
real(8), intent (in) :: ew
real(8), intent (in) :: t
code = abs(((ew * cos(t)) - (eh * (sin(t) * sin(atan((eh * (tan(t) / -ew))))))))
end function
public static double code(double eh, double ew, double t) {
return Math.abs(((ew * Math.cos(t)) - (eh * (Math.sin(t) * Math.sin(Math.atan((eh * (Math.tan(t) / -ew))))))));
}
def code(eh, ew, t): return math.fabs(((ew * math.cos(t)) - (eh * (math.sin(t) * math.sin(math.atan((eh * (math.tan(t) / -ew))))))))
function code(eh, ew, t) return abs(Float64(Float64(ew * cos(t)) - Float64(eh * Float64(sin(t) * sin(atan(Float64(eh * Float64(tan(t) / Float64(-ew))))))))) end
function tmp = code(eh, ew, t) tmp = abs(((ew * cos(t)) - (eh * (sin(t) * sin(atan((eh * (tan(t) / -ew)))))))); end
code[eh_, ew_, t_] := N[Abs[N[(N[(ew * N[Cos[t], $MachinePrecision]), $MachinePrecision] - N[(eh * N[(N[Sin[t], $MachinePrecision] * N[Sin[N[ArcTan[N[(eh * N[(N[Tan[t], $MachinePrecision] / (-ew)), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\left|ew \cdot \cos t - eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(eh \cdot \frac{\tan t}{-ew}\right)\right)\right|
\end{array}
Initial program 99.8%
sub-neg99.8%
associate-*l*99.8%
distribute-rgt-neg-in99.8%
cancel-sign-sub99.8%
associate-/l*99.8%
Simplified99.8%
cos-atan99.8%
un-div-inv99.8%
hypot-1-def99.8%
associate-*r/99.8%
*-commutative99.8%
associate-/l*99.8%
add-sqr-sqrt46.8%
sqrt-unprod93.0%
sqr-neg93.0%
sqrt-unprod53.0%
add-sqr-sqrt99.8%
Applied egg-rr99.8%
Taylor expanded in ew around inf 97.3%
Final simplification97.3%
(FPCore (eh ew t) :precision binary64 (if (or (<= ew -9.5e+89) (not (<= ew 1.38e+54))) (fabs (* ew (cos t))) (fabs (- ew (* eh (* (sin t) (sin (atan (* eh (/ (tan t) (- ew)))))))))))
double code(double eh, double ew, double t) {
double tmp;
if ((ew <= -9.5e+89) || !(ew <= 1.38e+54)) {
tmp = fabs((ew * cos(t)));
} else {
tmp = fabs((ew - (eh * (sin(t) * sin(atan((eh * (tan(t) / -ew))))))));
}
return tmp;
}
real(8) function code(eh, ew, t)
real(8), intent (in) :: eh
real(8), intent (in) :: ew
real(8), intent (in) :: t
real(8) :: tmp
if ((ew <= (-9.5d+89)) .or. (.not. (ew <= 1.38d+54))) then
tmp = abs((ew * cos(t)))
else
tmp = abs((ew - (eh * (sin(t) * sin(atan((eh * (tan(t) / -ew))))))))
end if
code = tmp
end function
public static double code(double eh, double ew, double t) {
double tmp;
if ((ew <= -9.5e+89) || !(ew <= 1.38e+54)) {
tmp = Math.abs((ew * Math.cos(t)));
} else {
tmp = Math.abs((ew - (eh * (Math.sin(t) * Math.sin(Math.atan((eh * (Math.tan(t) / -ew))))))));
}
return tmp;
}
def code(eh, ew, t): tmp = 0 if (ew <= -9.5e+89) or not (ew <= 1.38e+54): tmp = math.fabs((ew * math.cos(t))) else: tmp = math.fabs((ew - (eh * (math.sin(t) * math.sin(math.atan((eh * (math.tan(t) / -ew)))))))) return tmp
function code(eh, ew, t) tmp = 0.0 if ((ew <= -9.5e+89) || !(ew <= 1.38e+54)) tmp = abs(Float64(ew * cos(t))); else tmp = abs(Float64(ew - Float64(eh * Float64(sin(t) * sin(atan(Float64(eh * Float64(tan(t) / Float64(-ew))))))))); end return tmp end
function tmp_2 = code(eh, ew, t) tmp = 0.0; if ((ew <= -9.5e+89) || ~((ew <= 1.38e+54))) tmp = abs((ew * cos(t))); else tmp = abs((ew - (eh * (sin(t) * sin(atan((eh * (tan(t) / -ew)))))))); end tmp_2 = tmp; end
code[eh_, ew_, t_] := If[Or[LessEqual[ew, -9.5e+89], N[Not[LessEqual[ew, 1.38e+54]], $MachinePrecision]], N[Abs[N[(ew * N[Cos[t], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Abs[N[(ew - N[(eh * N[(N[Sin[t], $MachinePrecision] * N[Sin[N[ArcTan[N[(eh * N[(N[Tan[t], $MachinePrecision] / (-ew)), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;ew \leq -9.5 \cdot 10^{+89} \lor \neg \left(ew \leq 1.38 \cdot 10^{+54}\right):\\
\;\;\;\;\left|ew \cdot \cos t\right|\\
\mathbf{else}:\\
\;\;\;\;\left|ew - eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(eh \cdot \frac{\tan t}{-ew}\right)\right)\right|\\
\end{array}
\end{array}
if ew < -9.5000000000000003e89 or 1.38e54 < ew Initial program 99.9%
add-sqr-sqrt43.4%
sqrt-unprod85.3%
sqr-neg85.3%
sqrt-unprod56.5%
add-sqr-sqrt99.9%
pow199.9%
Applied egg-rr99.9%
unpow199.9%
Simplified99.9%
associate-*l*99.8%
*-commutative99.8%
associate-*r/99.8%
cos-atan99.9%
hypot-1-def99.8%
div-inv99.8%
clear-num99.7%
un-div-inv99.8%
associate-*r/99.8%
*-commutative99.8%
associate-/l*99.8%
Applied egg-rr99.8%
Taylor expanded in ew around inf 90.3%
if -9.5000000000000003e89 < ew < 1.38e54Initial program 99.8%
sub-neg99.8%
associate-*l*99.8%
distribute-rgt-neg-in99.8%
cancel-sign-sub99.8%
associate-/l*99.8%
Simplified99.8%
cos-atan99.8%
un-div-inv99.8%
hypot-1-def99.8%
associate-*r/99.8%
*-commutative99.8%
associate-/l*99.8%
add-sqr-sqrt48.9%
sqrt-unprod98.3%
sqr-neg98.3%
sqrt-unprod50.9%
add-sqr-sqrt99.8%
Applied egg-rr99.8%
Taylor expanded in t around 0 82.6%
Final simplification85.6%
(FPCore (eh ew t) :precision binary64 (if (or (<= eh -1.66e+162) (not (<= eh 1.85e+71))) (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 <= -1.66e+162) || !(eh <= 1.85e+71)) {
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 <= (-1.66d+162)) .or. (.not. (eh <= 1.85d+71))) 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 <= -1.66e+162) || !(eh <= 1.85e+71)) {
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 <= -1.66e+162) or not (eh <= 1.85e+71): 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 <= -1.66e+162) || !(eh <= 1.85e+71)) tmp = abs(Float64(eh * Float64(sin(t) * sin(atan(Float64(eh * Float64(tan(t) / 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 <= -1.66e+162) || ~((eh <= 1.85e+71))) 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, -1.66e+162], N[Not[LessEqual[eh, 1.85e+71]], $MachinePrecision]], N[Abs[N[(eh * N[(N[Sin[t], $MachinePrecision] * N[Sin[N[ArcTan[N[(eh * N[(N[Tan[t], $MachinePrecision] / (-ew)), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Abs[N[(ew * N[Cos[t], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;eh \leq -1.66 \cdot 10^{+162} \lor \neg \left(eh \leq 1.85 \cdot 10^{+71}\right):\\
\;\;\;\;\left|eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(eh \cdot \frac{\tan t}{-ew}\right)\right)\right|\\
\mathbf{else}:\\
\;\;\;\;\left|ew \cdot \cos t\right|\\
\end{array}
\end{array}
if eh < -1.66000000000000003e162 or 1.85e71 < eh Initial program 99.8%
sub-neg99.8%
associate-*l*99.8%
distribute-rgt-neg-in99.8%
cancel-sign-sub99.8%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in ew around 0 76.2%
associate-*r*76.2%
mul-1-neg76.2%
mul-1-neg76.2%
distribute-frac-neg276.2%
associate-/l*76.1%
Simplified76.1%
if -1.66000000000000003e162 < eh < 1.85e71Initial program 99.9%
add-sqr-sqrt50.7%
sqrt-unprod97.4%
sqr-neg97.4%
sqrt-unprod49.1%
add-sqr-sqrt99.9%
pow199.9%
Applied egg-rr99.9%
unpow199.9%
Simplified99.9%
associate-*l*99.9%
*-commutative99.9%
associate-*r/99.9%
cos-atan99.9%
hypot-1-def99.9%
div-inv99.9%
clear-num99.8%
un-div-inv99.8%
associate-*r/99.8%
*-commutative99.8%
associate-/l*99.8%
Applied egg-rr99.8%
Taylor expanded in ew around inf 77.2%
Final simplification76.9%
(FPCore (eh ew t)
:precision binary64
(let* ((t_1 (sin (atan (* eh (/ (tan t) (- ew)))))))
(if (<= eh -1.4e+163)
(fabs (* eh (* (sin t) t_1)))
(if (<= eh 3.5e+74)
(fabs (* ew (cos t)))
(fabs (* (* eh (sin t)) t_1))))))
double code(double eh, double ew, double t) {
double t_1 = sin(atan((eh * (tan(t) / -ew))));
double tmp;
if (eh <= -1.4e+163) {
tmp = fabs((eh * (sin(t) * t_1)));
} else if (eh <= 3.5e+74) {
tmp = fabs((ew * cos(t)));
} else {
tmp = fabs(((eh * sin(t)) * 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 = sin(atan((eh * (tan(t) / -ew))))
if (eh <= (-1.4d+163)) then
tmp = abs((eh * (sin(t) * t_1)))
else if (eh <= 3.5d+74) then
tmp = abs((ew * cos(t)))
else
tmp = abs(((eh * sin(t)) * t_1))
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 tmp;
if (eh <= -1.4e+163) {
tmp = Math.abs((eh * (Math.sin(t) * t_1)));
} else if (eh <= 3.5e+74) {
tmp = Math.abs((ew * Math.cos(t)));
} else {
tmp = Math.abs(((eh * Math.sin(t)) * t_1));
}
return tmp;
}
def code(eh, ew, t): t_1 = math.sin(math.atan((eh * (math.tan(t) / -ew)))) tmp = 0 if eh <= -1.4e+163: tmp = math.fabs((eh * (math.sin(t) * t_1))) elif eh <= 3.5e+74: tmp = math.fabs((ew * math.cos(t))) else: tmp = math.fabs(((eh * math.sin(t)) * t_1)) return tmp
function code(eh, ew, t) t_1 = sin(atan(Float64(eh * Float64(tan(t) / Float64(-ew))))) tmp = 0.0 if (eh <= -1.4e+163) tmp = abs(Float64(eh * Float64(sin(t) * t_1))); elseif (eh <= 3.5e+74) tmp = abs(Float64(ew * cos(t))); else tmp = abs(Float64(Float64(eh * sin(t)) * t_1)); end return tmp end
function tmp_2 = code(eh, ew, t) t_1 = sin(atan((eh * (tan(t) / -ew)))); tmp = 0.0; if (eh <= -1.4e+163) tmp = abs((eh * (sin(t) * t_1))); elseif (eh <= 3.5e+74) tmp = abs((ew * cos(t))); else tmp = abs(((eh * sin(t)) * t_1)); 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]}, If[LessEqual[eh, -1.4e+163], N[Abs[N[(eh * N[(N[Sin[t], $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[eh, 3.5e+74], N[Abs[N[(ew * N[Cos[t], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Abs[N[(N[(eh * N[Sin[t], $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision]], $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \sin \tan^{-1} \left(eh \cdot \frac{\tan t}{-ew}\right)\\
\mathbf{if}\;eh \leq -1.4 \cdot 10^{+163}:\\
\;\;\;\;\left|eh \cdot \left(\sin t \cdot t\_1\right)\right|\\
\mathbf{elif}\;eh \leq 3.5 \cdot 10^{+74}:\\
\;\;\;\;\left|ew \cdot \cos t\right|\\
\mathbf{else}:\\
\;\;\;\;\left|\left(eh \cdot \sin t\right) \cdot t\_1\right|\\
\end{array}
\end{array}
if eh < -1.40000000000000007e163Initial 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%
Taylor expanded in ew around 0 79.4%
associate-*r*79.4%
mul-1-neg79.4%
mul-1-neg79.4%
distribute-frac-neg279.4%
associate-/l*79.3%
Simplified79.3%
if -1.40000000000000007e163 < eh < 3.50000000000000014e74Initial program 99.9%
add-sqr-sqrt50.7%
sqrt-unprod97.4%
sqr-neg97.4%
sqrt-unprod49.1%
add-sqr-sqrt99.9%
pow199.9%
Applied egg-rr99.9%
unpow199.9%
Simplified99.9%
associate-*l*99.9%
*-commutative99.9%
associate-*r/99.9%
cos-atan99.9%
hypot-1-def99.9%
div-inv99.9%
clear-num99.8%
un-div-inv99.8%
associate-*r/99.8%
*-commutative99.8%
associate-/l*99.8%
Applied egg-rr99.8%
Taylor expanded in ew around inf 77.2%
if 3.50000000000000014e74 < 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%
Taylor expanded in ew around 0 74.2%
mul-1-neg74.2%
associate-*r*74.3%
distribute-lft-neg-in74.3%
distribute-rgt-neg-in74.3%
mul-1-neg74.3%
distribute-frac-neg274.3%
associate-/l*74.2%
Simplified74.2%
Final simplification76.9%
(FPCore (eh ew t) :precision binary64 (if (or (<= t -5.0) (not (<= t 7.8e-5))) (fabs (* ew (cos t))) (fabs (- ew (* (* t eh) (sin (atan (* (tan t) (/ eh (- ew))))))))))
double code(double eh, double ew, double t) {
double tmp;
if ((t <= -5.0) || !(t <= 7.8e-5)) {
tmp = fabs((ew * cos(t)));
} else {
tmp = fabs((ew - ((t * eh) * sin(atan((tan(t) * (eh / -ew)))))));
}
return tmp;
}
real(8) function code(eh, ew, t)
real(8), intent (in) :: eh
real(8), intent (in) :: ew
real(8), intent (in) :: t
real(8) :: tmp
if ((t <= (-5.0d0)) .or. (.not. (t <= 7.8d-5))) then
tmp = abs((ew * cos(t)))
else
tmp = abs((ew - ((t * eh) * sin(atan((tan(t) * (eh / -ew)))))))
end if
code = tmp
end function
public static double code(double eh, double ew, double t) {
double tmp;
if ((t <= -5.0) || !(t <= 7.8e-5)) {
tmp = Math.abs((ew * Math.cos(t)));
} else {
tmp = Math.abs((ew - ((t * eh) * Math.sin(Math.atan((Math.tan(t) * (eh / -ew)))))));
}
return tmp;
}
def code(eh, ew, t): tmp = 0 if (t <= -5.0) or not (t <= 7.8e-5): tmp = math.fabs((ew * math.cos(t))) else: tmp = math.fabs((ew - ((t * eh) * math.sin(math.atan((math.tan(t) * (eh / -ew))))))) return tmp
function code(eh, ew, t) tmp = 0.0 if ((t <= -5.0) || !(t <= 7.8e-5)) tmp = abs(Float64(ew * cos(t))); else tmp = abs(Float64(ew - Float64(Float64(t * eh) * sin(atan(Float64(tan(t) * Float64(eh / Float64(-ew)))))))); end return tmp end
function tmp_2 = code(eh, ew, t) tmp = 0.0; if ((t <= -5.0) || ~((t <= 7.8e-5))) tmp = abs((ew * cos(t))); else tmp = abs((ew - ((t * eh) * sin(atan((tan(t) * (eh / -ew))))))); end tmp_2 = tmp; end
code[eh_, ew_, t_] := If[Or[LessEqual[t, -5.0], N[Not[LessEqual[t, 7.8e-5]], $MachinePrecision]], N[Abs[N[(ew * N[Cos[t], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Abs[N[(ew - N[(N[(t * eh), $MachinePrecision] * N[Sin[N[ArcTan[N[(N[Tan[t], $MachinePrecision] * N[(eh / (-ew)), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -5 \lor \neg \left(t \leq 7.8 \cdot 10^{-5}\right):\\
\;\;\;\;\left|ew \cdot \cos t\right|\\
\mathbf{else}:\\
\;\;\;\;\left|ew - \left(t \cdot eh\right) \cdot \sin \tan^{-1} \left(\tan t \cdot \frac{eh}{-ew}\right)\right|\\
\end{array}
\end{array}
if t < -5 or 7.7999999999999999e-5 < t Initial program 99.7%
add-sqr-sqrt50.6%
sqrt-unprod94.7%
sqr-neg94.7%
sqrt-unprod49.1%
add-sqr-sqrt99.7%
pow199.7%
Applied egg-rr99.7%
unpow199.7%
Simplified99.7%
associate-*l*99.7%
*-commutative99.7%
associate-*r/99.7%
cos-atan99.7%
hypot-1-def99.7%
div-inv99.7%
clear-num99.5%
un-div-inv99.6%
associate-*r/99.6%
*-commutative99.6%
associate-/l*99.6%
Applied egg-rr99.6%
Taylor expanded in ew around inf 55.2%
if -5 < t < 7.7999999999999999e-5Initial program 100.0%
add-sqr-sqrt43.1%
sqrt-unprod91.9%
sqr-neg91.9%
sqrt-unprod56.9%
add-sqr-sqrt100.0%
pow1100.0%
Applied egg-rr100.0%
unpow1100.0%
Simplified100.0%
associate-*l*100.0%
*-commutative100.0%
associate-*r/100.0%
cos-atan100.0%
hypot-1-def100.0%
div-inv100.0%
clear-num100.0%
un-div-inv100.0%
associate-*r/100.0%
*-commutative100.0%
associate-/l*100.0%
Applied egg-rr100.0%
Taylor expanded in t around 0 97.3%
mul-1-neg97.3%
unsub-neg97.3%
associate-*r*97.3%
*-commutative97.3%
mul-1-neg97.3%
*-commutative97.3%
associate-*r/97.3%
*-commutative97.3%
distribute-rgt-neg-in97.3%
Simplified97.3%
Final simplification76.6%
(FPCore (eh ew t)
:precision binary64
(let* ((t_1 (fabs (* ew (cos t)))))
(if (<= ew -7.6e-118)
t_1
(if (<= ew 3.9e-230)
(* (* eh (- (sin t))) (sin (atan (* eh (/ (tan t) ew)))))
(if (<= ew 1.5e-157)
(+ 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 <= -7.6e-118) {
tmp = t_1;
} else if (ew <= 3.9e-230) {
tmp = (eh * -sin(t)) * sin(atan((eh * (tan(t) / ew))));
} else if (ew <= 1.5e-157) {
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 <= (-7.6d-118)) then
tmp = t_1
else if (ew <= 3.9d-230) then
tmp = (eh * -sin(t)) * sin(atan((eh * (tan(t) / ew))))
else if (ew <= 1.5d-157) 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 <= -7.6e-118) {
tmp = t_1;
} else if (ew <= 3.9e-230) {
tmp = (eh * -Math.sin(t)) * Math.sin(Math.atan((eh * (Math.tan(t) / ew))));
} else if (ew <= 1.5e-157) {
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 <= -7.6e-118: tmp = t_1 elif ew <= 3.9e-230: tmp = (eh * -math.sin(t)) * math.sin(math.atan((eh * (math.tan(t) / ew)))) elif ew <= 1.5e-157: 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 <= -7.6e-118) tmp = t_1; elseif (ew <= 3.9e-230) tmp = Float64(Float64(eh * Float64(-sin(t))) * sin(atan(Float64(eh * Float64(tan(t) / ew))))); elseif (ew <= 1.5e-157) 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 <= -7.6e-118) tmp = t_1; elseif (ew <= 3.9e-230) tmp = (eh * -sin(t)) * sin(atan((eh * (tan(t) / ew)))); elseif (ew <= 1.5e-157) 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, -7.6e-118], t$95$1, If[LessEqual[ew, 3.9e-230], 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], If[LessEqual[ew, 1.5e-157], 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 -7.6 \cdot 10^{-118}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;ew \leq 3.9 \cdot 10^{-230}:\\
\;\;\;\;\left(eh \cdot \left(-\sin t\right)\right) \cdot \sin \tan^{-1} \left(eh \cdot \frac{\tan t}{ew}\right)\\
\mathbf{elif}\;ew \leq 1.5 \cdot 10^{-157}:\\
\;\;\;\;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 < -7.6000000000000002e-118 or 1.5e-157 < ew Initial program 99.8%
add-sqr-sqrt46.7%
sqrt-unprod91.8%
sqr-neg91.8%
sqrt-unprod53.1%
add-sqr-sqrt99.8%
pow199.8%
Applied egg-rr99.8%
unpow199.8%
Simplified99.8%
associate-*l*99.8%
*-commutative99.8%
associate-*r/99.8%
cos-atan99.8%
hypot-1-def99.8%
div-inv99.8%
clear-num99.7%
un-div-inv99.8%
associate-*r/99.8%
*-commutative99.8%
associate-/l*99.8%
Applied egg-rr99.8%
Taylor expanded in ew around inf 75.0%
if -7.6000000000000002e-118 < ew < 3.9000000000000002e-230Initial 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-rr26.8%
Taylor expanded in ew around 0 20.0%
associate-*r*20.0%
associate-*r/20.0%
Simplified20.0%
add-sqr-sqrt12.1%
sqrt-unprod34.4%
sqr-neg34.4%
sqrt-unprod35.3%
add-sqr-sqrt61.8%
distribute-lft-neg-in61.8%
neg-sub061.8%
Applied egg-rr61.8%
neg-sub061.8%
distribute-rgt-neg-in61.8%
Simplified61.8%
if 3.9000000000000002e-230 < ew < 1.5e-157Initial 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-rr84.8%
Taylor expanded in t around 0 87.0%
(FPCore (eh ew t) :precision binary64 (if (<= eh 3.4e+163) (fabs (* ew (cos t))) (* (* eh (sin t)) (sin (atan (/ (* t eh) ew))))))
double code(double eh, double ew, double t) {
double tmp;
if (eh <= 3.4e+163) {
tmp = fabs((ew * cos(t)));
} else {
tmp = (eh * sin(t)) * sin(atan(((t * eh) / ew)));
}
return tmp;
}
real(8) function code(eh, ew, t)
real(8), intent (in) :: eh
real(8), intent (in) :: ew
real(8), intent (in) :: t
real(8) :: tmp
if (eh <= 3.4d+163) then
tmp = abs((ew * cos(t)))
else
tmp = (eh * sin(t)) * sin(atan(((t * eh) / ew)))
end if
code = tmp
end function
public static double code(double eh, double ew, double t) {
double tmp;
if (eh <= 3.4e+163) {
tmp = Math.abs((ew * Math.cos(t)));
} else {
tmp = (eh * Math.sin(t)) * Math.sin(Math.atan(((t * eh) / ew)));
}
return tmp;
}
def code(eh, ew, t): tmp = 0 if eh <= 3.4e+163: tmp = math.fabs((ew * math.cos(t))) else: tmp = (eh * math.sin(t)) * math.sin(math.atan(((t * eh) / ew))) return tmp
function code(eh, ew, t) tmp = 0.0 if (eh <= 3.4e+163) tmp = abs(Float64(ew * cos(t))); else tmp = Float64(Float64(eh * sin(t)) * sin(atan(Float64(Float64(t * eh) / ew)))); end return tmp end
function tmp_2 = code(eh, ew, t) tmp = 0.0; if (eh <= 3.4e+163) tmp = abs((ew * cos(t))); else tmp = (eh * sin(t)) * sin(atan(((t * eh) / ew))); end tmp_2 = tmp; end
code[eh_, ew_, t_] := If[LessEqual[eh, 3.4e+163], N[Abs[N[(ew * N[Cos[t], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(N[(eh * N[Sin[t], $MachinePrecision]), $MachinePrecision] * N[Sin[N[ArcTan[N[(N[(t * eh), $MachinePrecision] / ew), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;eh \leq 3.4 \cdot 10^{+163}:\\
\;\;\;\;\left|ew \cdot \cos t\right|\\
\mathbf{else}:\\
\;\;\;\;\left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{t \cdot eh}{ew}\right)\\
\end{array}
\end{array}
if eh < 3.4000000000000001e163Initial program 99.8%
add-sqr-sqrt53.2%
sqrt-unprod94.7%
sqr-neg94.7%
sqrt-unprod46.6%
add-sqr-sqrt99.8%
pow199.8%
Applied egg-rr99.8%
unpow199.8%
Simplified99.8%
associate-*l*99.8%
*-commutative99.8%
associate-*r/99.8%
cos-atan99.8%
hypot-1-def99.8%
div-inv99.8%
clear-num99.8%
un-div-inv99.8%
associate-*r/99.8%
*-commutative99.8%
associate-/l*99.8%
Applied egg-rr99.8%
Taylor expanded in ew around inf 68.4%
if 3.4000000000000001e163 < 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-rr44.6%
Taylor expanded in ew around 0 39.6%
associate-*r*39.6%
associate-*r/39.6%
Simplified39.6%
Taylor expanded in t around 0 48.8%
Final simplification66.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.8%
add-sqr-sqrt46.8%
sqrt-unprod93.3%
sqr-neg93.3%
sqrt-unprod53.1%
add-sqr-sqrt99.8%
pow199.8%
Applied egg-rr99.8%
unpow199.8%
Simplified99.8%
associate-*l*99.8%
*-commutative99.8%
associate-*r/99.8%
cos-atan99.8%
hypot-1-def99.8%
div-inv99.8%
clear-num99.8%
un-div-inv99.8%
associate-*r/99.8%
*-commutative99.8%
associate-/l*99.8%
Applied egg-rr99.8%
Taylor expanded in ew around inf 62.6%
(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%
add-sqr-sqrt46.8%
sqrt-unprod93.3%
sqr-neg93.3%
sqrt-unprod53.1%
add-sqr-sqrt99.8%
pow199.8%
Applied egg-rr99.8%
unpow199.8%
Simplified99.8%
associate-*l*99.8%
*-commutative99.8%
associate-*r/99.8%
cos-atan99.8%
hypot-1-def99.8%
div-inv99.8%
clear-num99.8%
un-div-inv99.8%
associate-*r/99.8%
*-commutative99.8%
associate-/l*99.8%
Applied egg-rr99.8%
Taylor expanded in t around 0 42.5%
(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.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-rr44.5%
Taylor expanded in t around 0 23.2%
rem-cube-cbrt23.5%
*-un-lft-identity23.5%
Applied egg-rr23.5%
Final simplification23.5%
herbie shell --seed 2024191
(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)))))))