
(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 17 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (eh ew t) :precision binary64 (let* ((t_1 (atan (/ (* (- eh) (tan t)) ew)))) (fabs (- (* (* ew (cos t)) (cos t_1)) (* (* eh (sin t)) (sin t_1))))))
double code(double eh, double ew, double t) {
double t_1 = atan(((-eh * tan(t)) / ew));
return fabs((((ew * cos(t)) * cos(t_1)) - ((eh * sin(t)) * sin(t_1))));
}
real(8) function code(eh, ew, t)
real(8), intent (in) :: eh
real(8), intent (in) :: ew
real(8), intent (in) :: t
real(8) :: t_1
t_1 = atan(((-eh * tan(t)) / ew))
code = abs((((ew * cos(t)) * cos(t_1)) - ((eh * sin(t)) * sin(t_1))))
end function
public static double code(double eh, double ew, double t) {
double t_1 = Math.atan(((-eh * Math.tan(t)) / ew));
return Math.abs((((ew * Math.cos(t)) * Math.cos(t_1)) - ((eh * Math.sin(t)) * Math.sin(t_1))));
}
def code(eh, ew, t): t_1 = math.atan(((-eh * math.tan(t)) / ew)) return math.fabs((((ew * math.cos(t)) * math.cos(t_1)) - ((eh * math.sin(t)) * math.sin(t_1))))
function code(eh, ew, t) t_1 = atan(Float64(Float64(Float64(-eh) * tan(t)) / ew)) return abs(Float64(Float64(Float64(ew * cos(t)) * cos(t_1)) - Float64(Float64(eh * sin(t)) * sin(t_1)))) end
function tmp = code(eh, ew, t) t_1 = atan(((-eh * tan(t)) / ew)); tmp = abs((((ew * cos(t)) * cos(t_1)) - ((eh * sin(t)) * sin(t_1)))); end
code[eh_, ew_, t_] := Block[{t$95$1 = N[ArcTan[N[(N[((-eh) * N[Tan[t], $MachinePrecision]), $MachinePrecision] / ew), $MachinePrecision]], $MachinePrecision]}, N[Abs[N[(N[(N[(ew * N[Cos[t], $MachinePrecision]), $MachinePrecision] * N[Cos[t$95$1], $MachinePrecision]), $MachinePrecision] - N[(N[(eh * N[Sin[t], $MachinePrecision]), $MachinePrecision] * N[Sin[t$95$1], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\\
\left|\left(ew \cdot \cos t\right) \cdot \cos t\_1 - \left(eh \cdot \sin t\right) \cdot \sin t\_1\right|
\end{array}
\end{array}
(FPCore (eh ew t) :precision binary64 (let* ((t_1 (atan (* eh (/ (tan t) (- ew)))))) (fabs (fma ew (* (cos t_1) (- (cos t))) (* eh (* (sin t) (sin t_1)))))))
double code(double eh, double ew, double t) {
double t_1 = atan((eh * (tan(t) / -ew)));
return fabs(fma(ew, (cos(t_1) * -cos(t)), (eh * (sin(t) * sin(t_1)))));
}
function code(eh, ew, t) t_1 = atan(Float64(eh * Float64(tan(t) / Float64(-ew)))) return abs(fma(ew, Float64(cos(t_1) * Float64(-cos(t))), Float64(eh * Float64(sin(t) * sin(t_1))))) end
code[eh_, ew_, t_] := Block[{t$95$1 = N[ArcTan[N[(eh * N[(N[Tan[t], $MachinePrecision] / (-ew)), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, N[Abs[N[(ew * N[(N[Cos[t$95$1], $MachinePrecision] * (-N[Cos[t], $MachinePrecision])), $MachinePrecision] + N[(eh * N[(N[Sin[t], $MachinePrecision] * N[Sin[t$95$1], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \tan^{-1} \left(eh \cdot \frac{\tan t}{-ew}\right)\\
\left|\mathsf{fma}\left(ew, \cos t\_1 \cdot \left(-\cos t\right), eh \cdot \left(\sin t \cdot \sin t\_1\right)\right)\right|
\end{array}
\end{array}
Initial program 99.8%
fabs-sub99.8%
sub-neg99.8%
+-commutative99.8%
associate-*l*99.8%
distribute-rgt-neg-in99.8%
fma-define99.8%
Simplified99.8%
Final simplification99.8%
(FPCore (eh ew t)
:precision binary64
(let* ((t_1 (* (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%
associate-*l*99.8%
distribute-rgt-neg-in99.8%
cancel-sign-sub99.8%
associate-/l*99.8%
Simplified99.8%
Applied egg-rr99.8%
associate-*r/99.8%
Applied egg-rr99.8%
(FPCore (eh ew t)
:precision binary64
(let* ((t_1 (* (tan t) (/ eh ew))))
(fabs
(+
(* eh (* (sin t) (sin (atan t_1))))
(* ew (/ (cos t) (hypot 1.0 t_1)))))))
double code(double eh, double ew, double t) {
double t_1 = tan(t) * (eh / ew);
return fabs(((eh * (sin(t) * sin(atan(t_1)))) + (ew * (cos(t) / hypot(1.0, t_1)))));
}
public static double code(double eh, double ew, double t) {
double t_1 = Math.tan(t) * (eh / ew);
return Math.abs(((eh * (Math.sin(t) * Math.sin(Math.atan(t_1)))) + (ew * (Math.cos(t) / Math.hypot(1.0, t_1)))));
}
def code(eh, ew, t): t_1 = math.tan(t) * (eh / ew) return math.fabs(((eh * (math.sin(t) * math.sin(math.atan(t_1)))) + (ew * (math.cos(t) / math.hypot(1.0, t_1)))))
function code(eh, ew, t) t_1 = Float64(tan(t) * Float64(eh / ew)) return abs(Float64(Float64(eh * Float64(sin(t) * sin(atan(t_1)))) + Float64(ew * Float64(cos(t) / hypot(1.0, t_1))))) end
function tmp = code(eh, ew, t) t_1 = tan(t) * (eh / ew); tmp = abs(((eh * (sin(t) * sin(atan(t_1)))) + (ew * (cos(t) / hypot(1.0, 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[(eh * N[(N[Sin[t], $MachinePrecision] * N[Sin[N[ArcTan[t$95$1], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(ew * N[(N[Cos[t], $MachinePrecision] / N[Sqrt[1.0 ^ 2 + t$95$1 ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \tan t \cdot \frac{eh}{ew}\\
\left|eh \cdot \left(\sin t \cdot \sin \tan^{-1} t\_1\right) + ew \cdot \frac{\cos t}{\mathsf{hypot}\left(1, t\_1\right)}\right|
\end{array}
\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-rr99.8%
Final simplification99.8%
(FPCore (eh ew t) :precision binary64 (fabs (+ (/ (* ew (cos t)) (hypot 1.0 (* (tan t) (/ eh ew)))) (* eh (* (sin t) (sin (atan (/ (* eh 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 * 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 * 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 * 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(Float64(eh * t) / 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 * 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[(N[(eh * t), $MachinePrecision] / ew), $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(\frac{eh \cdot 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%
Applied egg-rr99.8%
associate-*r/99.8%
Applied egg-rr99.8%
Taylor expanded in t around 0 99.0%
*-commutative99.0%
Simplified99.0%
Final simplification99.0%
(FPCore (eh ew t) :precision binary64 (fabs (+ (* ew (/ (cos t) (hypot 1.0 (* (tan t) (/ eh ew))))) (* eh (* (sin t) (sin (atan (/ (* eh 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 * 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 * 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 * t) / ew)))))))
function code(eh, ew, t) return abs(Float64(Float64(ew * Float64(cos(t) / hypot(1.0, Float64(tan(t) * Float64(eh / ew))))) + Float64(eh * Float64(sin(t) * sin(atan(Float64(Float64(eh * t) / 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 * t) / ew))))))); end
code[eh_, ew_, t_] := N[Abs[N[(N[(ew * N[(N[Cos[t], $MachinePrecision] / N[Sqrt[1.0 ^ 2 + N[(N[Tan[t], $MachinePrecision] * N[(eh / ew), $MachinePrecision]), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(eh * N[(N[Sin[t], $MachinePrecision] * N[Sin[N[ArcTan[N[(N[(eh * t), $MachinePrecision] / ew), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\left|ew \cdot \frac{\cos t}{\mathsf{hypot}\left(1, \tan t \cdot \frac{eh}{ew}\right)} + eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\frac{eh \cdot 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%
Applied egg-rr99.8%
Taylor expanded in t around 0 99.0%
*-commutative99.0%
Simplified99.0%
Final simplification99.0%
(FPCore (eh ew t) :precision binary64 (fabs (+ (* ew (cos t)) (* eh (* (sin t) (sin (atan (* (tan t) (/ eh ew)))))))))
double code(double eh, double ew, double t) {
return fabs(((ew * cos(t)) + (eh * (sin(t) * sin(atan((tan(t) * (eh / 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((tan(t) * (eh / 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((Math.tan(t) * (eh / ew))))))));
}
def code(eh, ew, t): return math.fabs(((ew * math.cos(t)) + (eh * (math.sin(t) * math.sin(math.atan((math.tan(t) * (eh / ew))))))))
function code(eh, ew, t) return abs(Float64(Float64(ew * cos(t)) + Float64(eh * Float64(sin(t) * sin(atan(Float64(tan(t) * Float64(eh / ew)))))))) end
function tmp = code(eh, ew, t) tmp = abs(((ew * cos(t)) + (eh * (sin(t) * sin(atan((tan(t) * (eh / 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[(N[Tan[t], $MachinePrecision] * N[(eh / 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(\tan t \cdot \frac{eh}{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%
Applied egg-rr99.8%
Taylor expanded in ew around inf 98.1%
(FPCore (eh ew t) :precision binary64 (if (or (<= eh -8e-95) (not (<= eh 0.0105))) (fabs (+ ew (* eh (* (sin t) (sin (atan (/ (* eh t) ew))))))) (fabs (* ew (* (cos t) (cos (atan (* (tan t) (/ eh (- ew))))))))))
double code(double eh, double ew, double t) {
double tmp;
if ((eh <= -8e-95) || !(eh <= 0.0105)) {
tmp = fabs((ew + (eh * (sin(t) * sin(atan(((eh * t) / ew)))))));
} else {
tmp = fabs((ew * (cos(t) * cos(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 ((eh <= (-8d-95)) .or. (.not. (eh <= 0.0105d0))) then
tmp = abs((ew + (eh * (sin(t) * sin(atan(((eh * t) / ew)))))))
else
tmp = abs((ew * (cos(t) * cos(atan((tan(t) * (eh / -ew)))))))
end if
code = tmp
end function
public static double code(double eh, double ew, double t) {
double tmp;
if ((eh <= -8e-95) || !(eh <= 0.0105)) {
tmp = Math.abs((ew + (eh * (Math.sin(t) * Math.sin(Math.atan(((eh * t) / ew)))))));
} else {
tmp = Math.abs((ew * (Math.cos(t) * Math.cos(Math.atan((Math.tan(t) * (eh / -ew)))))));
}
return tmp;
}
def code(eh, ew, t): tmp = 0 if (eh <= -8e-95) or not (eh <= 0.0105): tmp = math.fabs((ew + (eh * (math.sin(t) * math.sin(math.atan(((eh * t) / ew))))))) else: tmp = math.fabs((ew * (math.cos(t) * math.cos(math.atan((math.tan(t) * (eh / -ew))))))) return tmp
function code(eh, ew, t) tmp = 0.0 if ((eh <= -8e-95) || !(eh <= 0.0105)) tmp = abs(Float64(ew + Float64(eh * Float64(sin(t) * sin(atan(Float64(Float64(eh * t) / ew))))))); else tmp = abs(Float64(ew * Float64(cos(t) * cos(atan(Float64(tan(t) * Float64(eh / Float64(-ew)))))))); end return tmp end
function tmp_2 = code(eh, ew, t) tmp = 0.0; if ((eh <= -8e-95) || ~((eh <= 0.0105))) tmp = abs((ew + (eh * (sin(t) * sin(atan(((eh * t) / ew))))))); else tmp = abs((ew * (cos(t) * cos(atan((tan(t) * (eh / -ew))))))); end tmp_2 = tmp; end
code[eh_, ew_, t_] := If[Or[LessEqual[eh, -8e-95], N[Not[LessEqual[eh, 0.0105]], $MachinePrecision]], N[Abs[N[(ew + N[(eh * N[(N[Sin[t], $MachinePrecision] * N[Sin[N[ArcTan[N[(N[(eh * t), $MachinePrecision] / ew), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Abs[N[(ew * N[(N[Cos[t], $MachinePrecision] * N[Cos[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}\;eh \leq -8 \cdot 10^{-95} \lor \neg \left(eh \leq 0.0105\right):\\
\;\;\;\;\left|ew + eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\frac{eh \cdot t}{ew}\right)\right)\right|\\
\mathbf{else}:\\
\;\;\;\;\left|ew \cdot \left(\cos t \cdot \cos \tan^{-1} \left(\tan t \cdot \frac{eh}{-ew}\right)\right)\right|\\
\end{array}
\end{array}
if eh < -7.99999999999999992e-95 or 0.0105000000000000007 < 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%
Applied egg-rr99.8%
Taylor expanded in t around 0 88.6%
Taylor expanded in t around 0 88.6%
*-commutative99.8%
Simplified88.6%
if -7.99999999999999992e-95 < eh < 0.0105000000000000007Initial 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 inf 88.8%
associate-*r/88.8%
associate-*r*88.8%
*-commutative88.8%
associate-*l/88.8%
associate-*r/88.8%
mul-1-neg88.8%
Simplified88.8%
Final simplification88.7%
(FPCore (eh ew t) :precision binary64 (if (or (<= eh -1.15e+223) (not (<= eh 3.4e+180))) (fabs (* eh (* t (sin (atan (* eh (/ (tan t) (- ew)))))))) (fabs (* ew (cos (atan (* (tan t) (/ eh (- ew)))))))))
double code(double eh, double ew, double t) {
double tmp;
if ((eh <= -1.15e+223) || !(eh <= 3.4e+180)) {
tmp = fabs((eh * (t * sin(atan((eh * (tan(t) / -ew)))))));
} else {
tmp = fabs((ew * cos(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 ((eh <= (-1.15d+223)) .or. (.not. (eh <= 3.4d+180))) then
tmp = abs((eh * (t * sin(atan((eh * (tan(t) / -ew)))))))
else
tmp = abs((ew * cos(atan((tan(t) * (eh / -ew))))))
end if
code = tmp
end function
public static double code(double eh, double ew, double t) {
double tmp;
if ((eh <= -1.15e+223) || !(eh <= 3.4e+180)) {
tmp = Math.abs((eh * (t * Math.sin(Math.atan((eh * (Math.tan(t) / -ew)))))));
} else {
tmp = Math.abs((ew * Math.cos(Math.atan((Math.tan(t) * (eh / -ew))))));
}
return tmp;
}
def code(eh, ew, t): tmp = 0 if (eh <= -1.15e+223) or not (eh <= 3.4e+180): tmp = math.fabs((eh * (t * math.sin(math.atan((eh * (math.tan(t) / -ew))))))) else: tmp = math.fabs((ew * math.cos(math.atan((math.tan(t) * (eh / -ew)))))) return tmp
function code(eh, ew, t) tmp = 0.0 if ((eh <= -1.15e+223) || !(eh <= 3.4e+180)) tmp = abs(Float64(eh * Float64(t * sin(atan(Float64(eh * Float64(tan(t) / Float64(-ew)))))))); else tmp = abs(Float64(ew * cos(atan(Float64(tan(t) * Float64(eh / Float64(-ew))))))); end return tmp end
function tmp_2 = code(eh, ew, t) tmp = 0.0; if ((eh <= -1.15e+223) || ~((eh <= 3.4e+180))) tmp = abs((eh * (t * sin(atan((eh * (tan(t) / -ew))))))); else tmp = abs((ew * cos(atan((tan(t) * (eh / -ew)))))); end tmp_2 = tmp; end
code[eh_, ew_, t_] := If[Or[LessEqual[eh, -1.15e+223], N[Not[LessEqual[eh, 3.4e+180]], $MachinePrecision]], N[Abs[N[(eh * N[(t * 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[N[ArcTan[N[(N[Tan[t], $MachinePrecision] * N[(eh / (-ew)), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;eh \leq -1.15 \cdot 10^{+223} \lor \neg \left(eh \leq 3.4 \cdot 10^{+180}\right):\\
\;\;\;\;\left|eh \cdot \left(t \cdot \sin \tan^{-1} \left(eh \cdot \frac{\tan t}{-ew}\right)\right)\right|\\
\mathbf{else}:\\
\;\;\;\;\left|ew \cdot \cos \tan^{-1} \left(\tan t \cdot \frac{eh}{-ew}\right)\right|\\
\end{array}
\end{array}
if eh < -1.15000000000000002e223 or 3.39999999999999985e180 < 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 t around 0 61.0%
associate-*r*61.0%
neg-mul-161.0%
fma-define61.0%
associate-*r/61.0%
associate-*r*61.0%
*-commutative61.0%
associate-*l/61.0%
associate-*r/61.0%
mul-1-neg61.0%
associate-*r*61.0%
*-commutative61.0%
associate-*r*61.0%
Simplified61.0%
Taylor expanded in ew around 0 51.6%
mul-1-neg51.6%
associate-/l*51.5%
distribute-lft-neg-out51.5%
Simplified51.5%
if -1.15000000000000002e223 < eh < 3.39999999999999985e180Initial 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 t around 0 45.7%
associate-*r/45.7%
associate-*r*45.7%
*-commutative45.7%
associate-*l/45.7%
associate-*r/45.7%
mul-1-neg45.7%
Simplified45.7%
Final simplification46.7%
(FPCore (eh ew t)
:precision binary64
(let* ((t_1 (cos (atan (* (tan t) (/ eh (- ew)))))))
(if (<= ew -6.6e-40)
(* ew (- t_1))
(if (<= ew 3.4e-52)
(fabs (* eh (* (sin t) (sin (atan (/ (* eh t) (- ew)))))))
(fabs (* ew t_1))))))
double code(double eh, double ew, double t) {
double t_1 = cos(atan((tan(t) * (eh / -ew))));
double tmp;
if (ew <= -6.6e-40) {
tmp = ew * -t_1;
} else if (ew <= 3.4e-52) {
tmp = fabs((eh * (sin(t) * sin(atan(((eh * t) / -ew))))));
} else {
tmp = fabs((ew * 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 = cos(atan((tan(t) * (eh / -ew))))
if (ew <= (-6.6d-40)) then
tmp = ew * -t_1
else if (ew <= 3.4d-52) then
tmp = abs((eh * (sin(t) * sin(atan(((eh * t) / -ew))))))
else
tmp = abs((ew * t_1))
end if
code = tmp
end function
public static double code(double eh, double ew, double t) {
double t_1 = Math.cos(Math.atan((Math.tan(t) * (eh / -ew))));
double tmp;
if (ew <= -6.6e-40) {
tmp = ew * -t_1;
} else if (ew <= 3.4e-52) {
tmp = Math.abs((eh * (Math.sin(t) * Math.sin(Math.atan(((eh * t) / -ew))))));
} else {
tmp = Math.abs((ew * t_1));
}
return tmp;
}
def code(eh, ew, t): t_1 = math.cos(math.atan((math.tan(t) * (eh / -ew)))) tmp = 0 if ew <= -6.6e-40: tmp = ew * -t_1 elif ew <= 3.4e-52: tmp = math.fabs((eh * (math.sin(t) * math.sin(math.atan(((eh * t) / -ew)))))) else: tmp = math.fabs((ew * t_1)) return tmp
function code(eh, ew, t) t_1 = cos(atan(Float64(tan(t) * Float64(eh / Float64(-ew))))) tmp = 0.0 if (ew <= -6.6e-40) tmp = Float64(ew * Float64(-t_1)); elseif (ew <= 3.4e-52) tmp = abs(Float64(eh * Float64(sin(t) * sin(atan(Float64(Float64(eh * t) / Float64(-ew))))))); else tmp = abs(Float64(ew * t_1)); end return tmp end
function tmp_2 = code(eh, ew, t) t_1 = cos(atan((tan(t) * (eh / -ew)))); tmp = 0.0; if (ew <= -6.6e-40) tmp = ew * -t_1; elseif (ew <= 3.4e-52) tmp = abs((eh * (sin(t) * sin(atan(((eh * t) / -ew)))))); else tmp = abs((ew * t_1)); end tmp_2 = tmp; end
code[eh_, ew_, t_] := Block[{t$95$1 = N[Cos[N[ArcTan[N[(N[Tan[t], $MachinePrecision] * N[(eh / (-ew)), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]}, If[LessEqual[ew, -6.6e-40], N[(ew * (-t$95$1)), $MachinePrecision], If[LessEqual[ew, 3.4e-52], N[Abs[N[(eh * N[(N[Sin[t], $MachinePrecision] * N[Sin[N[ArcTan[N[(N[(eh * t), $MachinePrecision] / (-ew)), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Abs[N[(ew * t$95$1), $MachinePrecision]], $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \cos \tan^{-1} \left(\tan t \cdot \frac{eh}{-ew}\right)\\
\mathbf{if}\;ew \leq -6.6 \cdot 10^{-40}:\\
\;\;\;\;ew \cdot \left(-t\_1\right)\\
\mathbf{elif}\;ew \leq 3.4 \cdot 10^{-52}:\\
\;\;\;\;\left|eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\frac{eh \cdot t}{-ew}\right)\right)\right|\\
\mathbf{else}:\\
\;\;\;\;\left|ew \cdot t\_1\right|\\
\end{array}
\end{array}
if ew < -6.59999999999999986e-40Initial 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 t around 0 57.5%
associate-*r*57.5%
neg-mul-157.5%
fma-define57.5%
associate-*r/57.5%
associate-*r*57.5%
*-commutative57.5%
associate-*l/57.5%
associate-*r/57.5%
mul-1-neg57.5%
associate-*r*57.1%
*-commutative57.1%
associate-*r*57.5%
Simplified57.5%
Taylor expanded in ew around 0 57.5%
Simplified56.0%
Taylor expanded in t around 0 57.1%
associate-*r*57.1%
neg-mul-157.1%
mul-1-neg57.1%
*-commutative57.1%
distribute-frac-neg257.1%
associate-/l*57.1%
Simplified57.1%
if -6.59999999999999986e-40 < ew < 3.40000000000000017e-52Initial 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 eh around inf 99.8%
associate-/l*98.9%
associate-*r/98.9%
associate-*r*98.9%
*-commutative98.9%
associate-*l/98.9%
associate-*r/98.9%
mul-1-neg98.9%
Simplified98.9%
Taylor expanded in t around 0 97.0%
mul-1-neg97.0%
*-commutative97.0%
Simplified97.0%
Taylor expanded in eh around inf 70.3%
associate-*r*70.3%
neg-mul-170.3%
distribute-neg-frac70.3%
*-commutative70.3%
distribute-lft-neg-in70.3%
Simplified70.3%
if 3.40000000000000017e-52 < ew 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 t around 0 48.0%
associate-*r/48.0%
associate-*r*48.0%
*-commutative48.0%
associate-*l/48.0%
associate-*r/48.0%
mul-1-neg48.0%
Simplified48.0%
Final simplification60.3%
(FPCore (eh ew t)
:precision binary64
(let* ((t_1 (cos (atan (* (tan t) (/ eh (- ew)))))))
(if (<= ew -3.6e-203)
(* ew (- t_1))
(if (<= ew -2.5e-302)
(* (sin (atan (* eh (/ (tan t) (- ew))))) (* eh t))
(fabs (* ew t_1))))))
double code(double eh, double ew, double t) {
double t_1 = cos(atan((tan(t) * (eh / -ew))));
double tmp;
if (ew <= -3.6e-203) {
tmp = ew * -t_1;
} else if (ew <= -2.5e-302) {
tmp = sin(atan((eh * (tan(t) / -ew)))) * (eh * t);
} else {
tmp = fabs((ew * 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 = cos(atan((tan(t) * (eh / -ew))))
if (ew <= (-3.6d-203)) then
tmp = ew * -t_1
else if (ew <= (-2.5d-302)) then
tmp = sin(atan((eh * (tan(t) / -ew)))) * (eh * t)
else
tmp = abs((ew * t_1))
end if
code = tmp
end function
public static double code(double eh, double ew, double t) {
double t_1 = Math.cos(Math.atan((Math.tan(t) * (eh / -ew))));
double tmp;
if (ew <= -3.6e-203) {
tmp = ew * -t_1;
} else if (ew <= -2.5e-302) {
tmp = Math.sin(Math.atan((eh * (Math.tan(t) / -ew)))) * (eh * t);
} else {
tmp = Math.abs((ew * t_1));
}
return tmp;
}
def code(eh, ew, t): t_1 = math.cos(math.atan((math.tan(t) * (eh / -ew)))) tmp = 0 if ew <= -3.6e-203: tmp = ew * -t_1 elif ew <= -2.5e-302: tmp = math.sin(math.atan((eh * (math.tan(t) / -ew)))) * (eh * t) else: tmp = math.fabs((ew * t_1)) return tmp
function code(eh, ew, t) t_1 = cos(atan(Float64(tan(t) * Float64(eh / Float64(-ew))))) tmp = 0.0 if (ew <= -3.6e-203) tmp = Float64(ew * Float64(-t_1)); elseif (ew <= -2.5e-302) tmp = Float64(sin(atan(Float64(eh * Float64(tan(t) / Float64(-ew))))) * Float64(eh * t)); else tmp = abs(Float64(ew * t_1)); end return tmp end
function tmp_2 = code(eh, ew, t) t_1 = cos(atan((tan(t) * (eh / -ew)))); tmp = 0.0; if (ew <= -3.6e-203) tmp = ew * -t_1; elseif (ew <= -2.5e-302) tmp = sin(atan((eh * (tan(t) / -ew)))) * (eh * t); else tmp = abs((ew * t_1)); end tmp_2 = tmp; end
code[eh_, ew_, t_] := Block[{t$95$1 = N[Cos[N[ArcTan[N[(N[Tan[t], $MachinePrecision] * N[(eh / (-ew)), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]}, If[LessEqual[ew, -3.6e-203], N[(ew * (-t$95$1)), $MachinePrecision], If[LessEqual[ew, -2.5e-302], N[(N[Sin[N[ArcTan[N[(eh * N[(N[Tan[t], $MachinePrecision] / (-ew)), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * N[(eh * t), $MachinePrecision]), $MachinePrecision], N[Abs[N[(ew * t$95$1), $MachinePrecision]], $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \cos \tan^{-1} \left(\tan t \cdot \frac{eh}{-ew}\right)\\
\mathbf{if}\;ew \leq -3.6 \cdot 10^{-203}:\\
\;\;\;\;ew \cdot \left(-t\_1\right)\\
\mathbf{elif}\;ew \leq -2.5 \cdot 10^{-302}:\\
\;\;\;\;\sin \tan^{-1} \left(eh \cdot \frac{\tan t}{-ew}\right) \cdot \left(eh \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;\left|ew \cdot t\_1\right|\\
\end{array}
\end{array}
if ew < -3.59999999999999979e-203Initial 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 t around 0 56.4%
associate-*r*56.4%
neg-mul-156.4%
fma-define56.4%
associate-*r/56.4%
associate-*r*56.4%
*-commutative56.4%
associate-*l/56.4%
associate-*r/56.4%
mul-1-neg56.4%
associate-*r*56.2%
*-commutative56.2%
associate-*r*56.4%
Simplified56.4%
Taylor expanded in ew around 0 56.4%
Simplified55.2%
Taylor expanded in t around 0 50.6%
associate-*r*50.6%
neg-mul-150.6%
mul-1-neg50.6%
*-commutative50.6%
distribute-frac-neg250.6%
associate-/l*50.6%
Simplified50.6%
if -3.59999999999999979e-203 < ew < -2.50000000000000017e-302Initial program 99.9%
fabs-sub99.9%
sub-neg99.9%
+-commutative99.9%
associate-*l*99.9%
distribute-rgt-neg-in99.9%
fma-define99.9%
Simplified99.9%
Taylor expanded in t around 0 58.6%
associate-*r*58.6%
neg-mul-158.6%
fma-define58.6%
associate-*r/58.6%
associate-*r*58.6%
*-commutative58.6%
associate-*l/58.6%
associate-*r/58.6%
mul-1-neg58.6%
associate-*r*58.6%
*-commutative58.6%
associate-*r*58.6%
Simplified58.6%
Taylor expanded in ew around 0 58.6%
Simplified57.8%
Taylor expanded in t around inf 50.6%
associate-*r*50.6%
*-commutative50.6%
mul-1-neg50.6%
associate-/l*50.6%
distribute-rgt-neg-in50.6%
Simplified50.6%
if -2.50000000000000017e-302 < 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%
Taylor expanded in t around 0 37.5%
associate-*r/37.5%
associate-*r*37.5%
*-commutative37.5%
associate-*l/37.5%
associate-*r/37.5%
mul-1-neg37.5%
Simplified37.5%
Final simplification44.1%
(FPCore (eh ew t) :precision binary64 (fabs (+ ew (* eh (* (sin t) (sin (atan (/ (* eh t) ew))))))))
double code(double eh, double ew, double t) {
return fabs((ew + (eh * (sin(t) * sin(atan(((eh * 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 + (eh * (sin(t) * sin(atan(((eh * t) / ew)))))))
end function
public static double code(double eh, double ew, double t) {
return Math.abs((ew + (eh * (Math.sin(t) * Math.sin(Math.atan(((eh * t) / ew)))))));
}
def code(eh, ew, t): return math.fabs((ew + (eh * (math.sin(t) * math.sin(math.atan(((eh * t) / ew)))))))
function code(eh, ew, t) return abs(Float64(ew + Float64(eh * Float64(sin(t) * sin(atan(Float64(Float64(eh * t) / ew))))))) end
function tmp = code(eh, ew, t) tmp = abs((ew + (eh * (sin(t) * sin(atan(((eh * t) / ew))))))); end
code[eh_, ew_, t_] := N[Abs[N[(ew + N[(eh * N[(N[Sin[t], $MachinePrecision] * N[Sin[N[ArcTan[N[(N[(eh * t), $MachinePrecision] / ew), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\left|ew + eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\frac{eh \cdot 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%
Applied egg-rr99.8%
Taylor expanded in t around 0 76.6%
Taylor expanded in t around 0 76.6%
*-commutative99.0%
Simplified76.6%
Final simplification76.6%
(FPCore (eh ew t)
:precision binary64
(if (<= ew -4e-203)
(* ew (- (cos (atan (* (tan t) (/ eh (- ew)))))))
(if (<= ew -2.5e-302)
(* (sin (atan (* eh (/ (tan t) (- ew))))) (* eh t))
(fabs (* ew (/ 1.0 (hypot 1.0 (* (tan t) (/ eh ew)))))))))
double code(double eh, double ew, double t) {
double tmp;
if (ew <= -4e-203) {
tmp = ew * -cos(atan((tan(t) * (eh / -ew))));
} else if (ew <= -2.5e-302) {
tmp = sin(atan((eh * (tan(t) / -ew)))) * (eh * t);
} else {
tmp = fabs((ew * (1.0 / hypot(1.0, (tan(t) * (eh / ew))))));
}
return tmp;
}
public static double code(double eh, double ew, double t) {
double tmp;
if (ew <= -4e-203) {
tmp = ew * -Math.cos(Math.atan((Math.tan(t) * (eh / -ew))));
} else if (ew <= -2.5e-302) {
tmp = Math.sin(Math.atan((eh * (Math.tan(t) / -ew)))) * (eh * t);
} else {
tmp = Math.abs((ew * (1.0 / Math.hypot(1.0, (Math.tan(t) * (eh / ew))))));
}
return tmp;
}
def code(eh, ew, t): tmp = 0 if ew <= -4e-203: tmp = ew * -math.cos(math.atan((math.tan(t) * (eh / -ew)))) elif ew <= -2.5e-302: tmp = math.sin(math.atan((eh * (math.tan(t) / -ew)))) * (eh * t) else: tmp = math.fabs((ew * (1.0 / math.hypot(1.0, (math.tan(t) * (eh / ew)))))) return tmp
function code(eh, ew, t) tmp = 0.0 if (ew <= -4e-203) tmp = Float64(ew * Float64(-cos(atan(Float64(tan(t) * Float64(eh / Float64(-ew))))))); elseif (ew <= -2.5e-302) tmp = Float64(sin(atan(Float64(eh * Float64(tan(t) / Float64(-ew))))) * Float64(eh * t)); else tmp = abs(Float64(ew * Float64(1.0 / hypot(1.0, Float64(tan(t) * Float64(eh / ew)))))); end return tmp end
function tmp_2 = code(eh, ew, t) tmp = 0.0; if (ew <= -4e-203) tmp = ew * -cos(atan((tan(t) * (eh / -ew)))); elseif (ew <= -2.5e-302) tmp = sin(atan((eh * (tan(t) / -ew)))) * (eh * t); else tmp = abs((ew * (1.0 / hypot(1.0, (tan(t) * (eh / ew)))))); end tmp_2 = tmp; end
code[eh_, ew_, t_] := If[LessEqual[ew, -4e-203], N[(ew * (-N[Cos[N[ArcTan[N[(N[Tan[t], $MachinePrecision] * N[(eh / (-ew)), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision])), $MachinePrecision], If[LessEqual[ew, -2.5e-302], N[(N[Sin[N[ArcTan[N[(eh * N[(N[Tan[t], $MachinePrecision] / (-ew)), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * N[(eh * t), $MachinePrecision]), $MachinePrecision], N[Abs[N[(ew * N[(1.0 / N[Sqrt[1.0 ^ 2 + N[(N[Tan[t], $MachinePrecision] * N[(eh / ew), $MachinePrecision]), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;ew \leq -4 \cdot 10^{-203}:\\
\;\;\;\;ew \cdot \left(-\cos \tan^{-1} \left(\tan t \cdot \frac{eh}{-ew}\right)\right)\\
\mathbf{elif}\;ew \leq -2.5 \cdot 10^{-302}:\\
\;\;\;\;\sin \tan^{-1} \left(eh \cdot \frac{\tan t}{-ew}\right) \cdot \left(eh \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;\left|ew \cdot \frac{1}{\mathsf{hypot}\left(1, \tan t \cdot \frac{eh}{ew}\right)}\right|\\
\end{array}
\end{array}
if ew < -4.0000000000000001e-203Initial 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 t around 0 56.4%
associate-*r*56.4%
neg-mul-156.4%
fma-define56.4%
associate-*r/56.4%
associate-*r*56.4%
*-commutative56.4%
associate-*l/56.4%
associate-*r/56.4%
mul-1-neg56.4%
associate-*r*56.2%
*-commutative56.2%
associate-*r*56.4%
Simplified56.4%
Taylor expanded in ew around 0 56.4%
Simplified55.2%
Taylor expanded in t around 0 50.6%
associate-*r*50.6%
neg-mul-150.6%
mul-1-neg50.6%
*-commutative50.6%
distribute-frac-neg250.6%
associate-/l*50.6%
Simplified50.6%
if -4.0000000000000001e-203 < ew < -2.50000000000000017e-302Initial program 99.9%
fabs-sub99.9%
sub-neg99.9%
+-commutative99.9%
associate-*l*99.9%
distribute-rgt-neg-in99.9%
fma-define99.9%
Simplified99.9%
Taylor expanded in t around 0 58.6%
associate-*r*58.6%
neg-mul-158.6%
fma-define58.6%
associate-*r/58.6%
associate-*r*58.6%
*-commutative58.6%
associate-*l/58.6%
associate-*r/58.6%
mul-1-neg58.6%
associate-*r*58.6%
*-commutative58.6%
associate-*r*58.6%
Simplified58.6%
Taylor expanded in ew around 0 58.6%
Simplified57.8%
Taylor expanded in t around inf 50.6%
associate-*r*50.6%
*-commutative50.6%
mul-1-neg50.6%
associate-/l*50.6%
distribute-rgt-neg-in50.6%
Simplified50.6%
if -2.50000000000000017e-302 < 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%
Taylor expanded in t around 0 37.5%
associate-*r/37.5%
associate-*r*37.5%
*-commutative37.5%
associate-*l/37.5%
associate-*r/37.5%
mul-1-neg37.5%
Simplified37.5%
associate-*r/37.5%
*-commutative37.5%
cos-atan37.2%
hypot-1-def37.2%
*-commutative37.2%
associate-*r/37.2%
Applied egg-rr37.2%
distribute-frac-neg37.2%
distribute-rgt-neg-in37.2%
hypot-undefine37.2%
sqr-neg37.2%
hypot-undefine37.2%
Simplified37.2%
Final simplification43.9%
(FPCore (eh ew t) :precision binary64 (fabs (* ew (/ 1.0 (hypot 1.0 (* (tan t) (/ eh ew)))))))
double code(double eh, double ew, double t) {
return fabs((ew * (1.0 / hypot(1.0, (tan(t) * (eh / ew))))));
}
public static double code(double eh, double ew, double t) {
return Math.abs((ew * (1.0 / Math.hypot(1.0, (Math.tan(t) * (eh / ew))))));
}
def code(eh, ew, t): return math.fabs((ew * (1.0 / math.hypot(1.0, (math.tan(t) * (eh / ew))))))
function code(eh, ew, t) return abs(Float64(ew * Float64(1.0 / hypot(1.0, Float64(tan(t) * Float64(eh / ew)))))) end
function tmp = code(eh, ew, t) tmp = abs((ew * (1.0 / hypot(1.0, (tan(t) * (eh / ew)))))); end
code[eh_, ew_, t_] := N[Abs[N[(ew * N[(1.0 / N[Sqrt[1.0 ^ 2 + N[(N[Tan[t], $MachinePrecision] * N[(eh / ew), $MachinePrecision]), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\left|ew \cdot \frac{1}{\mathsf{hypot}\left(1, \tan t \cdot \frac{eh}{ew}\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%
Taylor expanded in t around 0 40.0%
associate-*r/40.0%
associate-*r*40.0%
*-commutative40.0%
associate-*l/40.0%
associate-*r/40.0%
mul-1-neg40.0%
Simplified40.0%
associate-*r/40.0%
*-commutative40.0%
cos-atan39.7%
hypot-1-def39.8%
*-commutative39.8%
associate-*r/39.7%
Applied egg-rr39.7%
distribute-frac-neg39.7%
distribute-rgt-neg-in39.7%
hypot-undefine39.7%
sqr-neg39.7%
hypot-undefine39.7%
Simplified39.7%
(FPCore (eh ew t) :precision binary64 (* (cos (atan (* t (/ eh ew)))) (fabs ew)))
double code(double eh, double ew, double t) {
return cos(atan((t * (eh / ew)))) * 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 = cos(atan((t * (eh / ew)))) * abs(ew)
end function
public static double code(double eh, double ew, double t) {
return Math.cos(Math.atan((t * (eh / ew)))) * Math.abs(ew);
}
def code(eh, ew, t): return math.cos(math.atan((t * (eh / ew)))) * math.fabs(ew)
function code(eh, ew, t) return Float64(cos(atan(Float64(t * Float64(eh / ew)))) * abs(ew)) end
function tmp = code(eh, ew, t) tmp = cos(atan((t * (eh / ew)))) * abs(ew); end
code[eh_, ew_, t_] := N[(N[Cos[N[ArcTan[N[(t * N[(eh / ew), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * N[Abs[ew], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\cos \tan^{-1} \left(t \cdot \frac{eh}{ew}\right) \cdot \left|ew\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%
Taylor expanded in t around 0 40.0%
associate-*r/40.0%
associate-*r*40.0%
*-commutative40.0%
associate-*l/40.0%
associate-*r/40.0%
mul-1-neg40.0%
Simplified40.0%
Taylor expanded in t around 0 38.7%
mul-1-neg86.8%
*-commutative86.8%
Simplified38.7%
*-un-lft-identity38.7%
atan-neg38.7%
cos-neg38.7%
associate-/l*38.7%
Applied egg-rr38.7%
*-lft-identity38.7%
*-commutative38.7%
fabs-mul38.7%
rem-square-sqrt38.7%
fabs-sqr38.7%
rem-square-sqrt38.7%
Simplified38.7%
(FPCore (eh ew t) :precision binary64 (fabs (* ew (/ 1.0 (hypot 1.0 (* t (/ eh ew)))))))
double code(double eh, double ew, double t) {
return fabs((ew * (1.0 / hypot(1.0, (t * (eh / ew))))));
}
public static double code(double eh, double ew, double t) {
return Math.abs((ew * (1.0 / Math.hypot(1.0, (t * (eh / ew))))));
}
def code(eh, ew, t): return math.fabs((ew * (1.0 / math.hypot(1.0, (t * (eh / ew))))))
function code(eh, ew, t) return abs(Float64(ew * Float64(1.0 / hypot(1.0, Float64(t * Float64(eh / ew)))))) end
function tmp = code(eh, ew, t) tmp = abs((ew * (1.0 / hypot(1.0, (t * (eh / ew)))))); end
code[eh_, ew_, t_] := N[Abs[N[(ew * N[(1.0 / N[Sqrt[1.0 ^ 2 + N[(t * N[(eh / ew), $MachinePrecision]), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\left|ew \cdot \frac{1}{\mathsf{hypot}\left(1, t \cdot \frac{eh}{ew}\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%
Taylor expanded in t around 0 40.0%
associate-*r/40.0%
associate-*r*40.0%
*-commutative40.0%
associate-*l/40.0%
associate-*r/40.0%
mul-1-neg40.0%
Simplified40.0%
Taylor expanded in t around 0 38.7%
mul-1-neg86.8%
*-commutative86.8%
Simplified38.7%
cos-atan37.6%
hypot-1-def37.6%
distribute-neg-frac237.6%
Applied egg-rr37.6%
hypot-undefine37.6%
metadata-eval37.6%
distribute-frac-neg237.6%
associate-*r/37.6%
distribute-frac-neg237.6%
associate-*r/37.7%
sqr-neg37.7%
hypot-1-def37.8%
Simplified37.8%
(FPCore (eh ew t) :precision binary64 (* ew (cos (atan (* t (/ eh ew))))))
double code(double eh, double ew, double t) {
return ew * cos(atan((t * (eh / 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 * cos(atan((t * (eh / ew))))
end function
public static double code(double eh, double ew, double t) {
return ew * Math.cos(Math.atan((t * (eh / ew))));
}
def code(eh, ew, t): return ew * math.cos(math.atan((t * (eh / ew))))
function code(eh, ew, t) return Float64(ew * cos(atan(Float64(t * Float64(eh / ew))))) end
function tmp = code(eh, ew, t) tmp = ew * cos(atan((t * (eh / ew)))); end
code[eh_, ew_, t_] := N[(ew * N[Cos[N[ArcTan[N[(t * N[(eh / ew), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
ew \cdot \cos \tan^{-1} \left(t \cdot \frac{eh}{ew}\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%
Taylor expanded in t around 0 40.0%
associate-*r/40.0%
associate-*r*40.0%
*-commutative40.0%
associate-*l/40.0%
associate-*r/40.0%
mul-1-neg40.0%
Simplified40.0%
Taylor expanded in t around 0 38.7%
mul-1-neg86.8%
*-commutative86.8%
Simplified38.7%
*-un-lft-identity38.7%
atan-neg38.7%
cos-neg38.7%
associate-/l*38.7%
Applied egg-rr38.7%
*-lft-identity38.7%
rem-square-sqrt17.5%
fabs-sqr17.5%
rem-square-sqrt18.4%
Simplified18.4%
(FPCore (eh ew t) :precision binary64 (* ew (/ 1.0 (hypot 1.0 (* t (/ eh ew))))))
double code(double eh, double ew, double t) {
return ew * (1.0 / hypot(1.0, (t * (eh / ew))));
}
public static double code(double eh, double ew, double t) {
return ew * (1.0 / Math.hypot(1.0, (t * (eh / ew))));
}
def code(eh, ew, t): return ew * (1.0 / math.hypot(1.0, (t * (eh / ew))))
function code(eh, ew, t) return Float64(ew * Float64(1.0 / hypot(1.0, Float64(t * Float64(eh / ew))))) end
function tmp = code(eh, ew, t) tmp = ew * (1.0 / hypot(1.0, (t * (eh / ew)))); end
code[eh_, ew_, t_] := N[(ew * N[(1.0 / N[Sqrt[1.0 ^ 2 + N[(t * N[(eh / ew), $MachinePrecision]), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
ew \cdot \frac{1}{\mathsf{hypot}\left(1, t \cdot \frac{eh}{ew}\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%
Taylor expanded in t around 0 40.0%
associate-*r/40.0%
associate-*r*40.0%
*-commutative40.0%
associate-*l/40.0%
associate-*r/40.0%
mul-1-neg40.0%
Simplified40.0%
Taylor expanded in t around 0 38.7%
mul-1-neg86.8%
*-commutative86.8%
Simplified38.7%
*-un-lft-identity38.7%
atan-neg38.7%
cos-neg38.7%
associate-/l*38.7%
Applied egg-rr38.7%
*-lft-identity38.7%
rem-square-sqrt17.5%
fabs-sqr17.5%
rem-square-sqrt18.4%
Simplified18.4%
associate-*r/18.4%
cos-atan18.1%
hypot-1-def18.1%
associate-*r/18.1%
Applied egg-rr18.1%
herbie shell --seed 2024188
(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)))))))