
(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 (- (* (* 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(eh * Float64(tan(t) / Float64(-ew)))) return abs(Float64(Float64(Float64(ew * cos(t)) * cos(t_1)) - Float64(eh * Float64(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[(eh * N[(N[Tan[t], $MachinePrecision] / (-ew)), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, N[Abs[N[(N[(N[(ew * N[Cos[t], $MachinePrecision]), $MachinePrecision] * N[Cos[t$95$1], $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|\left(ew \cdot \cos t\right) \cdot \cos t\_1 - eh \cdot \left(\sin t \cdot \sin 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%
Final simplification99.8%
(FPCore (eh ew t) :precision binary64 (fabs (- (* (* ew (cos t)) (/ 1.0 (hypot 1.0 (/ eh (/ ew (tan t)))))) (* eh (* (sin t) (sin (atan (* eh (/ (tan t) (- ew))))))))))
double code(double eh, double ew, double t) {
return fabs((((ew * cos(t)) * (1.0 / hypot(1.0, (eh / (ew / tan(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.cos(t)) * (1.0 / Math.hypot(1.0, (eh / (ew / Math.tan(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)) * (1.0 / math.hypot(1.0, (eh / (ew / math.tan(t)))))) - (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)) * Float64(1.0 / hypot(1.0, Float64(eh / Float64(ew / tan(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)) * (1.0 / hypot(1.0, (eh / (ew / tan(t)))))) - (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[(1.0 / N[Sqrt[1.0 ^ 2 + N[(eh / N[(ew / N[Tan[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] ^ 2], $MachinePrecision]), $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|\left(ew \cdot \cos t\right) \cdot \frac{1}{\mathsf{hypot}\left(1, \frac{eh}{\frac{ew}{\tan t}}\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-atan43.5%
hypot-1-def43.6%
add-sqr-sqrt20.2%
sqrt-unprod38.4%
sqr-neg38.4%
sqrt-unprod23.3%
add-sqr-sqrt43.6%
clear-num43.6%
un-div-inv43.6%
Applied egg-rr99.8%
Final simplification99.8%
(FPCore (eh ew t) :precision binary64 (fabs (- (* (* ew (cos t)) (cos (atan (* eh (/ (tan t) (- ew)))))) (* eh (* (sin t) (sin (atan (* eh (/ t (- ew))))))))))
double code(double eh, double ew, double t) {
return fabs((((ew * cos(t)) * cos(atan((eh * (tan(t) / -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 * cos(t)) * cos(atan((eh * (tan(t) / -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 * Math.cos(t)) * Math.cos(Math.atan((eh * (Math.tan(t) / -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.cos(math.atan((eh * (math.tan(t) / -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)) * cos(atan(Float64(eh * Float64(tan(t) / Float64(-ew)))))) - Float64(eh * Float64(sin(t) * sin(atan(Float64(eh * Float64(t / Float64(-ew))))))))) end
function tmp = code(eh, ew, t) tmp = abs((((ew * cos(t)) * cos(atan((eh * (tan(t) / -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[Cos[N[ArcTan[N[(eh * N[(N[Tan[t], $MachinePrecision] / (-ew)), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - N[(eh * N[(N[Sin[t], $MachinePrecision] * N[Sin[N[ArcTan[N[(eh * N[(t / (-ew)), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(eh \cdot \frac{\tan t}{-ew}\right) - eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(eh \cdot \frac{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%
Taylor expanded in t around 0 98.9%
Final simplification98.9%
(FPCore (eh ew t) :precision binary64 (if (or (<= ew -80.0) (not (<= ew 2.5e+42))) (fabs (* (* ew (cos t)) (cos (atan (* (- eh) (/ (tan t) ew)))))) (fabs (- (* ew (cos (atan (* (- eh) (/ t ew))))) (* eh (sin t))))))
double code(double eh, double ew, double t) {
double tmp;
if ((ew <= -80.0) || !(ew <= 2.5e+42)) {
tmp = fabs(((ew * cos(t)) * cos(atan((-eh * (tan(t) / ew))))));
} else {
tmp = fabs(((ew * cos(atan((-eh * (t / ew))))) - (eh * sin(t))));
}
return tmp;
}
real(8) function code(eh, ew, t)
real(8), intent (in) :: eh
real(8), intent (in) :: ew
real(8), intent (in) :: t
real(8) :: tmp
if ((ew <= (-80.0d0)) .or. (.not. (ew <= 2.5d+42))) then
tmp = abs(((ew * cos(t)) * cos(atan((-eh * (tan(t) / ew))))))
else
tmp = abs(((ew * cos(atan((-eh * (t / ew))))) - (eh * sin(t))))
end if
code = tmp
end function
public static double code(double eh, double ew, double t) {
double tmp;
if ((ew <= -80.0) || !(ew <= 2.5e+42)) {
tmp = Math.abs(((ew * Math.cos(t)) * Math.cos(Math.atan((-eh * (Math.tan(t) / ew))))));
} else {
tmp = Math.abs(((ew * Math.cos(Math.atan((-eh * (t / ew))))) - (eh * Math.sin(t))));
}
return tmp;
}
def code(eh, ew, t): tmp = 0 if (ew <= -80.0) or not (ew <= 2.5e+42): tmp = math.fabs(((ew * math.cos(t)) * math.cos(math.atan((-eh * (math.tan(t) / ew)))))) else: tmp = math.fabs(((ew * math.cos(math.atan((-eh * (t / ew))))) - (eh * math.sin(t)))) return tmp
function code(eh, ew, t) tmp = 0.0 if ((ew <= -80.0) || !(ew <= 2.5e+42)) tmp = abs(Float64(Float64(ew * cos(t)) * cos(atan(Float64(Float64(-eh) * Float64(tan(t) / ew)))))); else tmp = abs(Float64(Float64(ew * cos(atan(Float64(Float64(-eh) * Float64(t / ew))))) - Float64(eh * sin(t)))); end return tmp end
function tmp_2 = code(eh, ew, t) tmp = 0.0; if ((ew <= -80.0) || ~((ew <= 2.5e+42))) tmp = abs(((ew * cos(t)) * cos(atan((-eh * (tan(t) / ew)))))); else tmp = abs(((ew * cos(atan((-eh * (t / ew))))) - (eh * sin(t)))); end tmp_2 = tmp; end
code[eh_, ew_, t_] := If[Or[LessEqual[ew, -80.0], N[Not[LessEqual[ew, 2.5e+42]], $MachinePrecision]], N[Abs[N[(N[(ew * N[Cos[t], $MachinePrecision]), $MachinePrecision] * N[Cos[N[ArcTan[N[((-eh) * N[(N[Tan[t], $MachinePrecision] / ew), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Abs[N[(N[(ew * N[Cos[N[ArcTan[N[((-eh) * N[(t / ew), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - N[(eh * N[Sin[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;ew \leq -80 \lor \neg \left(ew \leq 2.5 \cdot 10^{+42}\right):\\
\;\;\;\;\left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right)\right|\\
\mathbf{else}:\\
\;\;\;\;\left|ew \cdot \cos \tan^{-1} \left(\left(-eh\right) \cdot \frac{t}{ew}\right) - eh \cdot \sin t\right|\\
\end{array}
\end{array}
if ew < -80 or 2.50000000000000003e42 < 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-rr91.4%
+-inverses91.4%
*-commutative91.4%
associate-/l*91.4%
mul0-lft91.4%
Simplified91.4%
if -80 < ew < 2.50000000000000003e42Initial program 99.8%
sub-neg99.8%
associate-*l*99.9%
distribute-rgt-neg-in99.9%
cancel-sign-sub99.9%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in t around 0 90.6%
associate-*r*90.6%
sin-atan56.5%
associate-*r/55.5%
add-sqr-sqrt26.1%
sqrt-unprod48.2%
sqr-neg48.2%
sqrt-unprod29.3%
add-sqr-sqrt54.5%
clear-num54.4%
un-div-inv54.4%
hypot-1-def70.6%
add-sqr-sqrt31.7%
Applied egg-rr70.8%
Taylor expanded in eh around inf 89.4%
Taylor expanded in t around 0 88.3%
Final simplification89.7%
(FPCore (eh ew t)
:precision binary64
(let* ((t_1 (* ew (cos t))))
(if (<= ew 8.6e+140)
(fabs (- (* t_1 (cos (atan (* (- eh) (/ t ew))))) (* eh (sin t))))
(fabs (* t_1 (cos (atan (* (- eh) (/ (tan t) ew)))))))))
double code(double eh, double ew, double t) {
double t_1 = ew * cos(t);
double tmp;
if (ew <= 8.6e+140) {
tmp = fabs(((t_1 * cos(atan((-eh * (t / ew))))) - (eh * sin(t))));
} else {
tmp = fabs((t_1 * cos(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 = ew * cos(t)
if (ew <= 8.6d+140) then
tmp = abs(((t_1 * cos(atan((-eh * (t / ew))))) - (eh * sin(t))))
else
tmp = abs((t_1 * cos(atan((-eh * (tan(t) / 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 tmp;
if (ew <= 8.6e+140) {
tmp = Math.abs(((t_1 * Math.cos(Math.atan((-eh * (t / ew))))) - (eh * Math.sin(t))));
} else {
tmp = Math.abs((t_1 * Math.cos(Math.atan((-eh * (Math.tan(t) / ew))))));
}
return tmp;
}
def code(eh, ew, t): t_1 = ew * math.cos(t) tmp = 0 if ew <= 8.6e+140: tmp = math.fabs(((t_1 * math.cos(math.atan((-eh * (t / ew))))) - (eh * math.sin(t)))) else: tmp = math.fabs((t_1 * math.cos(math.atan((-eh * (math.tan(t) / ew)))))) return tmp
function code(eh, ew, t) t_1 = Float64(ew * cos(t)) tmp = 0.0 if (ew <= 8.6e+140) tmp = abs(Float64(Float64(t_1 * cos(atan(Float64(Float64(-eh) * Float64(t / ew))))) - Float64(eh * sin(t)))); else tmp = abs(Float64(t_1 * cos(atan(Float64(Float64(-eh) * Float64(tan(t) / ew)))))); end return tmp end
function tmp_2 = code(eh, ew, t) t_1 = ew * cos(t); tmp = 0.0; if (ew <= 8.6e+140) tmp = abs(((t_1 * cos(atan((-eh * (t / ew))))) - (eh * sin(t)))); else tmp = abs((t_1 * cos(atan((-eh * (tan(t) / ew)))))); end tmp_2 = tmp; end
code[eh_, ew_, t_] := Block[{t$95$1 = N[(ew * N[Cos[t], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[ew, 8.6e+140], N[Abs[N[(N[(t$95$1 * N[Cos[N[ArcTan[N[((-eh) * N[(t / ew), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - N[(eh * N[Sin[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Abs[N[(t$95$1 * N[Cos[N[ArcTan[N[((-eh) * N[(N[Tan[t], $MachinePrecision] / ew), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := ew \cdot \cos t\\
\mathbf{if}\;ew \leq 8.6 \cdot 10^{+140}:\\
\;\;\;\;\left|t\_1 \cdot \cos \tan^{-1} \left(\left(-eh\right) \cdot \frac{t}{ew}\right) - eh \cdot \sin t\right|\\
\mathbf{else}:\\
\;\;\;\;\left|t\_1 \cdot \cos \tan^{-1} \left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right)\right|\\
\end{array}
\end{array}
if ew < 8.60000000000000004e140Initial 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 91.1%
associate-*r*91.1%
sin-atan68.8%
associate-*r/66.9%
add-sqr-sqrt32.2%
sqrt-unprod57.7%
sqr-neg57.7%
sqrt-unprod34.4%
add-sqr-sqrt66.0%
clear-num66.0%
un-div-inv66.0%
hypot-1-def76.5%
add-sqr-sqrt35.9%
Applied egg-rr76.6%
Taylor expanded in eh around inf 90.0%
if 8.60000000000000004e140 < 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-rr95.8%
+-inverses95.8%
*-commutative95.8%
associate-/l*95.8%
mul0-lft95.8%
Simplified95.8%
Final simplification90.8%
(FPCore (eh ew t) :precision binary64 (fabs (+ (* eh (sin t)) (* (* ew (cos t)) (/ -1.0 (hypot 1.0 (/ eh (/ ew (tan t)))))))))
double code(double eh, double ew, double t) {
return fabs(((eh * sin(t)) + ((ew * cos(t)) * (-1.0 / hypot(1.0, (eh / (ew / tan(t))))))));
}
public static double code(double eh, double ew, double t) {
return Math.abs(((eh * Math.sin(t)) + ((ew * Math.cos(t)) * (-1.0 / Math.hypot(1.0, (eh / (ew / Math.tan(t))))))));
}
def code(eh, ew, t): return math.fabs(((eh * math.sin(t)) + ((ew * math.cos(t)) * (-1.0 / math.hypot(1.0, (eh / (ew / math.tan(t))))))))
function code(eh, ew, t) return abs(Float64(Float64(eh * sin(t)) + Float64(Float64(ew * cos(t)) * Float64(-1.0 / hypot(1.0, Float64(eh / Float64(ew / tan(t)))))))) end
function tmp = code(eh, ew, t) tmp = abs(((eh * sin(t)) + ((ew * cos(t)) * (-1.0 / hypot(1.0, (eh / (ew / tan(t)))))))); end
code[eh_, ew_, t_] := N[Abs[N[(N[(eh * N[Sin[t], $MachinePrecision]), $MachinePrecision] + N[(N[(ew * N[Cos[t], $MachinePrecision]), $MachinePrecision] * N[(-1.0 / N[Sqrt[1.0 ^ 2 + N[(eh / N[(ew / N[Tan[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\left|eh \cdot \sin t + \left(ew \cdot \cos t\right) \cdot \frac{-1}{\mathsf{hypot}\left(1, \frac{eh}{\frac{ew}{\tan t}}\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%
associate-*r*88.8%
sin-atan69.4%
associate-*r/67.5%
add-sqr-sqrt32.5%
sqrt-unprod57.8%
sqr-neg57.8%
sqrt-unprod34.7%
add-sqr-sqrt66.7%
clear-num66.6%
un-div-inv66.6%
hypot-1-def75.8%
add-sqr-sqrt35.7%
Applied egg-rr86.2%
associate-*l*86.1%
associate-/l*92.0%
associate-/r/87.8%
associate-*r*87.8%
associate-/r/87.7%
associate-*l/87.7%
associate-/l*87.8%
Simplified87.8%
Taylor expanded in eh around inf 97.9%
cos-atan43.5%
hypot-1-def43.6%
add-sqr-sqrt20.2%
sqrt-unprod38.4%
sqr-neg38.4%
sqrt-unprod23.3%
add-sqr-sqrt43.6%
clear-num43.6%
un-div-inv43.6%
Applied egg-rr97.9%
Final simplification97.9%
(FPCore (eh ew t)
:precision binary64
(let* ((t_1 (cos (atan (* (- eh) (/ t ew))))))
(if (or (<= ew -2e+49) (not (<= ew 8.5e+44)))
(fabs (* (* ew (cos t)) t_1))
(fabs (- (* ew t_1) (* eh (sin t)))))))
double code(double eh, double ew, double t) {
double t_1 = cos(atan((-eh * (t / ew))));
double tmp;
if ((ew <= -2e+49) || !(ew <= 8.5e+44)) {
tmp = fabs(((ew * cos(t)) * t_1));
} else {
tmp = fabs(((ew * t_1) - (eh * sin(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) :: t_1
real(8) :: tmp
t_1 = cos(atan((-eh * (t / ew))))
if ((ew <= (-2d+49)) .or. (.not. (ew <= 8.5d+44))) then
tmp = abs(((ew * cos(t)) * t_1))
else
tmp = abs(((ew * t_1) - (eh * sin(t))))
end if
code = tmp
end function
public static double code(double eh, double ew, double t) {
double t_1 = Math.cos(Math.atan((-eh * (t / ew))));
double tmp;
if ((ew <= -2e+49) || !(ew <= 8.5e+44)) {
tmp = Math.abs(((ew * Math.cos(t)) * t_1));
} else {
tmp = Math.abs(((ew * t_1) - (eh * Math.sin(t))));
}
return tmp;
}
def code(eh, ew, t): t_1 = math.cos(math.atan((-eh * (t / ew)))) tmp = 0 if (ew <= -2e+49) or not (ew <= 8.5e+44): tmp = math.fabs(((ew * math.cos(t)) * t_1)) else: tmp = math.fabs(((ew * t_1) - (eh * math.sin(t)))) return tmp
function code(eh, ew, t) t_1 = cos(atan(Float64(Float64(-eh) * Float64(t / ew)))) tmp = 0.0 if ((ew <= -2e+49) || !(ew <= 8.5e+44)) tmp = abs(Float64(Float64(ew * cos(t)) * t_1)); else tmp = abs(Float64(Float64(ew * t_1) - Float64(eh * sin(t)))); end return tmp end
function tmp_2 = code(eh, ew, t) t_1 = cos(atan((-eh * (t / ew)))); tmp = 0.0; if ((ew <= -2e+49) || ~((ew <= 8.5e+44))) tmp = abs(((ew * cos(t)) * t_1)); else tmp = abs(((ew * t_1) - (eh * sin(t)))); end tmp_2 = tmp; end
code[eh_, ew_, t_] := Block[{t$95$1 = N[Cos[N[ArcTan[N[((-eh) * N[(t / ew), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]}, If[Or[LessEqual[ew, -2e+49], N[Not[LessEqual[ew, 8.5e+44]], $MachinePrecision]], N[Abs[N[(N[(ew * N[Cos[t], $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision]], $MachinePrecision], N[Abs[N[(N[(ew * t$95$1), $MachinePrecision] - N[(eh * N[Sin[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \cos \tan^{-1} \left(\left(-eh\right) \cdot \frac{t}{ew}\right)\\
\mathbf{if}\;ew \leq -2 \cdot 10^{+49} \lor \neg \left(ew \leq 8.5 \cdot 10^{+44}\right):\\
\;\;\;\;\left|\left(ew \cdot \cos t\right) \cdot t\_1\right|\\
\mathbf{else}:\\
\;\;\;\;\left|ew \cdot t\_1 - eh \cdot \sin t\right|\\
\end{array}
\end{array}
if ew < -1.99999999999999989e49 or 8.5e44 < 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 86.5%
Applied egg-rr80.1%
+-inverses92.4%
*-commutative92.4%
associate-/l*92.4%
mul0-lft92.4%
Simplified80.1%
if -1.99999999999999989e49 < ew < 8.5e44Initial program 99.8%
sub-neg99.8%
associate-*l*99.9%
distribute-rgt-neg-in99.9%
cancel-sign-sub99.9%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in t around 0 90.4%
associate-*r*90.4%
sin-atan57.3%
associate-*r/56.4%
add-sqr-sqrt26.6%
sqrt-unprod49.0%
sqr-neg49.0%
sqrt-unprod29.3%
add-sqr-sqrt55.1%
clear-num55.0%
un-div-inv55.0%
hypot-1-def70.6%
add-sqr-sqrt32.0%
Applied egg-rr70.8%
Taylor expanded in eh around inf 88.7%
Taylor expanded in t around 0 87.7%
Final simplification84.5%
(FPCore (eh ew t) :precision binary64 (if (or (<= ew -4200000.0) (not (<= ew 1.65e+44))) (fabs (* (* ew (cos t)) (/ 1.0 (hypot 1.0 (/ eh (/ ew (tan t))))))) (fabs (- (* ew (cos (atan (* (- eh) (/ t ew))))) (* eh (sin t))))))
double code(double eh, double ew, double t) {
double tmp;
if ((ew <= -4200000.0) || !(ew <= 1.65e+44)) {
tmp = fabs(((ew * cos(t)) * (1.0 / hypot(1.0, (eh / (ew / tan(t)))))));
} else {
tmp = fabs(((ew * cos(atan((-eh * (t / ew))))) - (eh * sin(t))));
}
return tmp;
}
public static double code(double eh, double ew, double t) {
double tmp;
if ((ew <= -4200000.0) || !(ew <= 1.65e+44)) {
tmp = Math.abs(((ew * Math.cos(t)) * (1.0 / Math.hypot(1.0, (eh / (ew / Math.tan(t)))))));
} else {
tmp = Math.abs(((ew * Math.cos(Math.atan((-eh * (t / ew))))) - (eh * Math.sin(t))));
}
return tmp;
}
def code(eh, ew, t): tmp = 0 if (ew <= -4200000.0) or not (ew <= 1.65e+44): tmp = math.fabs(((ew * math.cos(t)) * (1.0 / math.hypot(1.0, (eh / (ew / math.tan(t))))))) else: tmp = math.fabs(((ew * math.cos(math.atan((-eh * (t / ew))))) - (eh * math.sin(t)))) return tmp
function code(eh, ew, t) tmp = 0.0 if ((ew <= -4200000.0) || !(ew <= 1.65e+44)) tmp = abs(Float64(Float64(ew * cos(t)) * Float64(1.0 / hypot(1.0, Float64(eh / Float64(ew / tan(t))))))); else tmp = abs(Float64(Float64(ew * cos(atan(Float64(Float64(-eh) * Float64(t / ew))))) - Float64(eh * sin(t)))); end return tmp end
function tmp_2 = code(eh, ew, t) tmp = 0.0; if ((ew <= -4200000.0) || ~((ew <= 1.65e+44))) tmp = abs(((ew * cos(t)) * (1.0 / hypot(1.0, (eh / (ew / tan(t))))))); else tmp = abs(((ew * cos(atan((-eh * (t / ew))))) - (eh * sin(t)))); end tmp_2 = tmp; end
code[eh_, ew_, t_] := If[Or[LessEqual[ew, -4200000.0], N[Not[LessEqual[ew, 1.65e+44]], $MachinePrecision]], N[Abs[N[(N[(ew * N[Cos[t], $MachinePrecision]), $MachinePrecision] * N[(1.0 / N[Sqrt[1.0 ^ 2 + N[(eh / N[(ew / N[Tan[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Abs[N[(N[(ew * N[Cos[N[ArcTan[N[((-eh) * N[(t / ew), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - N[(eh * N[Sin[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;ew \leq -4200000 \lor \neg \left(ew \leq 1.65 \cdot 10^{+44}\right):\\
\;\;\;\;\left|\left(ew \cdot \cos t\right) \cdot \frac{1}{\mathsf{hypot}\left(1, \frac{eh}{\frac{ew}{\tan t}}\right)}\right|\\
\mathbf{else}:\\
\;\;\;\;\left|ew \cdot \cos \tan^{-1} \left(\left(-eh\right) \cdot \frac{t}{ew}\right) - eh \cdot \sin t\right|\\
\end{array}
\end{array}
if ew < -4.2e6 or 1.65000000000000007e44 < 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%
cos-atan58.4%
hypot-1-def58.4%
add-sqr-sqrt31.0%
sqrt-unprod47.3%
sqr-neg47.3%
sqrt-unprod27.5%
add-sqr-sqrt58.4%
clear-num58.4%
un-div-inv58.4%
Applied egg-rr99.8%
Applied egg-rr91.3%
+-inverses91.4%
*-commutative91.4%
associate-/l*91.4%
mul0-lft91.4%
Simplified91.3%
if -4.2e6 < ew < 1.65000000000000007e44Initial program 99.8%
sub-neg99.8%
associate-*l*99.9%
distribute-rgt-neg-in99.9%
cancel-sign-sub99.9%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in t around 0 90.6%
associate-*r*90.6%
sin-atan56.5%
associate-*r/55.5%
add-sqr-sqrt26.1%
sqrt-unprod48.2%
sqr-neg48.2%
sqrt-unprod29.3%
add-sqr-sqrt54.5%
clear-num54.4%
un-div-inv54.4%
hypot-1-def70.6%
add-sqr-sqrt31.7%
Applied egg-rr70.8%
Taylor expanded in eh around inf 89.4%
Taylor expanded in t around 0 88.3%
Final simplification89.6%
(FPCore (eh ew t) :precision binary64 (fabs (- (* ew (cos (atan (* eh (/ t (- ew)))))) (* eh (sin t)))))
double code(double eh, double ew, double t) {
return fabs(((ew * cos(atan((eh * (t / -ew))))) - (eh * sin(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(atan((eh * (t / -ew))))) - (eh * sin(t))))
end function
public static double code(double eh, double ew, double t) {
return Math.abs(((ew * Math.cos(Math.atan((eh * (t / -ew))))) - (eh * Math.sin(t))));
}
def code(eh, ew, t): return math.fabs(((ew * math.cos(math.atan((eh * (t / -ew))))) - (eh * math.sin(t))))
function code(eh, ew, t) return abs(Float64(Float64(ew * cos(atan(Float64(eh * Float64(t / Float64(-ew)))))) - Float64(eh * sin(t)))) end
function tmp = code(eh, ew, t) tmp = abs(((ew * cos(atan((eh * (t / -ew))))) - (eh * sin(t)))); end
code[eh_, ew_, t_] := N[Abs[N[(N[(ew * N[Cos[N[ArcTan[N[(eh * N[(t / (-ew)), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - N[(eh * N[Sin[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\left|ew \cdot \cos \tan^{-1} \left(eh \cdot \frac{t}{-ew}\right) - eh \cdot \sin t\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 88.8%
associate-*r*88.8%
sin-atan69.4%
associate-*r/67.5%
add-sqr-sqrt32.5%
sqrt-unprod57.8%
sqr-neg57.8%
sqrt-unprod34.7%
add-sqr-sqrt66.7%
clear-num66.6%
un-div-inv66.6%
hypot-1-def75.8%
add-sqr-sqrt35.7%
Applied egg-rr75.9%
Taylor expanded in eh around inf 87.8%
Taylor expanded in t around 0 77.6%
Final simplification77.6%
(FPCore (eh ew t) :precision binary64 (fabs (* ew (cos (atan (* eh (/ (tan t) (- ew))))))))
double code(double eh, double ew, double t) {
return fabs((ew * cos(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(atan((eh * (tan(t) / -ew))))))
end function
public static double code(double eh, double ew, double t) {
return Math.abs((ew * Math.cos(Math.atan((eh * (Math.tan(t) / -ew))))));
}
def code(eh, ew, t): return math.fabs((ew * math.cos(math.atan((eh * (math.tan(t) / -ew))))))
function code(eh, ew, t) return abs(Float64(ew * cos(atan(Float64(eh * Float64(tan(t) / Float64(-ew))))))) end
function tmp = code(eh, ew, t) tmp = abs((ew * cos(atan((eh * (tan(t) / -ew)))))); end
code[eh_, ew_, t_] := N[Abs[N[(ew * N[Cos[N[ArcTan[N[(eh * N[(N[Tan[t], $MachinePrecision] / (-ew)), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\left|ew \cdot \cos \tan^{-1} \left(eh \cdot \frac{\tan t}{-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%
Applied egg-rr62.9%
+-inverses62.9%
*-commutative62.9%
associate-/l*62.9%
mul0-lft62.9%
Simplified62.9%
Taylor expanded in t around 0 43.8%
Final simplification43.8%
(FPCore (eh ew t) :precision binary64 (fabs (* ew (/ 1.0 (hypot 1.0 (/ eh (/ ew (tan t))))))))
double code(double eh, double ew, double t) {
return fabs((ew * (1.0 / hypot(1.0, (eh / (ew / tan(t)))))));
}
public static double code(double eh, double ew, double t) {
return Math.abs((ew * (1.0 / Math.hypot(1.0, (eh / (ew / Math.tan(t)))))));
}
def code(eh, ew, t): return math.fabs((ew * (1.0 / math.hypot(1.0, (eh / (ew / math.tan(t)))))))
function code(eh, ew, t) return abs(Float64(ew * Float64(1.0 / hypot(1.0, Float64(eh / Float64(ew / tan(t))))))) end
function tmp = code(eh, ew, t) tmp = abs((ew * (1.0 / hypot(1.0, (eh / (ew / tan(t))))))); end
code[eh_, ew_, t_] := N[Abs[N[(ew * N[(1.0 / N[Sqrt[1.0 ^ 2 + N[(eh / N[(ew / N[Tan[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\left|ew \cdot \frac{1}{\mathsf{hypot}\left(1, \frac{eh}{\frac{ew}{\tan t}}\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-rr62.9%
+-inverses62.9%
*-commutative62.9%
associate-/l*62.9%
mul0-lft62.9%
Simplified62.9%
Taylor expanded in t around 0 43.8%
cos-atan43.5%
hypot-1-def43.6%
add-sqr-sqrt20.2%
sqrt-unprod38.4%
sqr-neg38.4%
sqrt-unprod23.3%
add-sqr-sqrt43.6%
clear-num43.6%
un-div-inv43.6%
Applied egg-rr43.6%
Final simplification43.6%
(FPCore (eh ew t) :precision binary64 (fabs (/ ew (hypot 1.0 (* (tan t) (/ eh ew))))))
double code(double eh, double ew, double t) {
return fabs((ew / hypot(1.0, (tan(t) * (eh / ew)))));
}
public static double code(double eh, double ew, double t) {
return Math.abs((ew / Math.hypot(1.0, (Math.tan(t) * (eh / ew)))));
}
def code(eh, ew, t): return math.fabs((ew / math.hypot(1.0, (math.tan(t) * (eh / ew)))))
function code(eh, ew, t) return abs(Float64(ew / hypot(1.0, Float64(tan(t) * Float64(eh / ew))))) end
function tmp = code(eh, ew, t) tmp = abs((ew / hypot(1.0, (tan(t) * (eh / ew))))); end
code[eh_, ew_, t_] := N[Abs[N[(ew / N[Sqrt[1.0 ^ 2 + N[(N[Tan[t], $MachinePrecision] * N[(eh / ew), $MachinePrecision]), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\left|\frac{ew}{\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%
Applied egg-rr62.9%
+-inverses62.9%
*-commutative62.9%
associate-/l*62.9%
mul0-lft62.9%
Simplified62.9%
Taylor expanded in t around 0 43.8%
cos-atan43.5%
un-div-inv43.5%
hypot-1-def43.6%
add-sqr-sqrt20.2%
sqrt-unprod38.4%
sqr-neg38.4%
sqrt-unprod23.3%
add-sqr-sqrt43.6%
associate-*r/43.6%
associate-*l/43.6%
*-commutative43.6%
Applied egg-rr43.6%
Final simplification43.6%
(FPCore (eh ew t) :precision binary64 (fabs (* ew (cos (atan (/ eh (/ ew t)))))))
double code(double eh, double ew, double t) {
return fabs((ew * cos(atan((eh / (ew / 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(atan((eh / (ew / t))))))
end function
public static double code(double eh, double ew, double t) {
return Math.abs((ew * Math.cos(Math.atan((eh / (ew / t))))));
}
def code(eh, ew, t): return math.fabs((ew * math.cos(math.atan((eh / (ew / t))))))
function code(eh, ew, t) return abs(Float64(ew * cos(atan(Float64(eh / Float64(ew / t)))))) end
function tmp = code(eh, ew, t) tmp = abs((ew * cos(atan((eh / (ew / t)))))); end
code[eh_, ew_, t_] := N[Abs[N[(ew * N[Cos[N[ArcTan[N[(eh / N[(ew / t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\left|ew \cdot \cos \tan^{-1} \left(\frac{eh}{\frac{ew}{t}}\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-rr62.9%
+-inverses62.9%
*-commutative62.9%
associate-/l*62.9%
mul0-lft62.9%
Simplified62.9%
Taylor expanded in t around 0 43.8%
Taylor expanded in t around 0 42.3%
clear-num42.3%
un-div-inv42.3%
add-sqr-sqrt19.6%
sqrt-unprod37.6%
sqr-neg37.6%
sqrt-unprod22.7%
add-sqr-sqrt42.3%
Applied egg-rr42.3%
Final simplification42.3%
(FPCore (eh ew t) :precision binary64 (fabs (/ ew (hypot 1.0 (* eh (/ t ew))))))
double code(double eh, double ew, double t) {
return fabs((ew / hypot(1.0, (eh * (t / ew)))));
}
public static double code(double eh, double ew, double t) {
return Math.abs((ew / Math.hypot(1.0, (eh * (t / ew)))));
}
def code(eh, ew, t): return math.fabs((ew / math.hypot(1.0, (eh * (t / ew)))))
function code(eh, ew, t) return abs(Float64(ew / hypot(1.0, Float64(eh * Float64(t / ew))))) end
function tmp = code(eh, ew, t) tmp = abs((ew / hypot(1.0, (eh * (t / ew))))); end
code[eh_, ew_, t_] := N[Abs[N[(ew / N[Sqrt[1.0 ^ 2 + N[(eh * N[(t / ew), $MachinePrecision]), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\left|\frac{ew}{\mathsf{hypot}\left(1, eh \cdot \frac{t}{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%
Applied egg-rr62.9%
+-inverses62.9%
*-commutative62.9%
associate-/l*62.9%
mul0-lft62.9%
Simplified62.9%
Taylor expanded in t around 0 43.8%
Taylor expanded in t around 0 42.3%
expm1-log1p-u29.3%
expm1-undefine15.4%
Applied egg-rr15.1%
log1p-undefine15.1%
rem-exp-log27.7%
+-commutative27.7%
associate--l+41.2%
metadata-eval41.2%
+-rgt-identity41.2%
associate-/l*41.3%
Simplified41.3%
Final simplification41.3%
herbie shell --seed 2024059
(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)))))))