
(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 13 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (eh ew t) :precision binary64 (let* ((t_1 (atan (/ (* (- eh) (tan t)) ew)))) (fabs (- (* (* ew (cos t)) (cos t_1)) (* (* eh (sin t)) (sin t_1))))))
double code(double eh, double ew, double t) {
double t_1 = atan(((-eh * tan(t)) / ew));
return fabs((((ew * cos(t)) * cos(t_1)) - ((eh * sin(t)) * sin(t_1))));
}
real(8) function code(eh, ew, t)
real(8), intent (in) :: eh
real(8), intent (in) :: ew
real(8), intent (in) :: t
real(8) :: t_1
t_1 = atan(((-eh * tan(t)) / ew))
code = abs((((ew * cos(t)) * cos(t_1)) - ((eh * sin(t)) * sin(t_1))))
end function
public static double code(double eh, double ew, double t) {
double t_1 = Math.atan(((-eh * Math.tan(t)) / ew));
return Math.abs((((ew * Math.cos(t)) * Math.cos(t_1)) - ((eh * Math.sin(t)) * Math.sin(t_1))));
}
def code(eh, ew, t): t_1 = math.atan(((-eh * math.tan(t)) / ew)) return math.fabs((((ew * math.cos(t)) * math.cos(t_1)) - ((eh * math.sin(t)) * math.sin(t_1))))
function code(eh, ew, t) t_1 = atan(Float64(Float64(Float64(-eh) * tan(t)) / ew)) return abs(Float64(Float64(Float64(ew * cos(t)) * cos(t_1)) - Float64(Float64(eh * sin(t)) * sin(t_1)))) end
function tmp = code(eh, ew, t) t_1 = atan(((-eh * tan(t)) / ew)); tmp = abs((((ew * cos(t)) * cos(t_1)) - ((eh * sin(t)) * sin(t_1)))); end
code[eh_, ew_, t_] := Block[{t$95$1 = N[ArcTan[N[(N[((-eh) * N[Tan[t], $MachinePrecision]), $MachinePrecision] / ew), $MachinePrecision]], $MachinePrecision]}, N[Abs[N[(N[(N[(ew * N[Cos[t], $MachinePrecision]), $MachinePrecision] * N[Cos[t$95$1], $MachinePrecision]), $MachinePrecision] - N[(N[(eh * N[Sin[t], $MachinePrecision]), $MachinePrecision] * N[Sin[t$95$1], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\\
\left|\left(ew \cdot \cos t\right) \cdot \cos t_1 - \left(eh \cdot \sin t\right) \cdot \sin t_1\right|
\end{array}
\end{array}
(FPCore (eh ew t) :precision binary64 (fabs (- (* (log (exp (/ 1.0 (hypot 1.0 (* (/ eh ew) (tan t)))))) (* ew (cos t))) (* (* eh (sin t)) (sin (atan (/ (* eh (- (tan t))) ew)))))))
double code(double eh, double ew, double t) {
return fabs(((log(exp((1.0 / hypot(1.0, ((eh / ew) * 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(((Math.log(Math.exp((1.0 / Math.hypot(1.0, ((eh / ew) * 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(((math.log(math.exp((1.0 / math.hypot(1.0, ((eh / ew) * 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(log(exp(Float64(1.0 / hypot(1.0, Float64(Float64(eh / ew) * tan(t)))))) * Float64(ew * cos(t))) - Float64(Float64(eh * sin(t)) * sin(atan(Float64(Float64(eh * Float64(-tan(t))) / ew)))))) end
function tmp = code(eh, ew, t) tmp = abs(((log(exp((1.0 / hypot(1.0, ((eh / ew) * tan(t)))))) * (ew * cos(t))) - ((eh * sin(t)) * sin(atan(((eh * -tan(t)) / ew)))))); end
code[eh_, ew_, t_] := N[Abs[N[(N[(N[Log[N[Exp[N[(1.0 / N[Sqrt[1.0 ^ 2 + N[(N[(eh / ew), $MachinePrecision] * N[Tan[t], $MachinePrecision]), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * N[(ew * 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|\log \left(e^{\frac{1}{\mathsf{hypot}\left(1, \frac{eh}{ew} \cdot \tan t\right)}}\right) \cdot \left(ew \cdot \cos t\right) - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{eh \cdot \left(-\tan t\right)}{ew}\right)\right|
\end{array}
Initial program 99.8%
add-log-exp99.8%
associate-/l*99.8%
associate-/r/99.8%
add-sqr-sqrt50.7%
sqrt-unprod92.8%
sqr-neg92.8%
sqrt-unprod49.1%
add-sqr-sqrt99.8%
Applied egg-rr99.8%
cos-atan99.8%
hypot-1-def99.8%
Applied egg-rr99.8%
Final simplification99.8%
(FPCore (eh ew t) :precision binary64 (fabs (- (* (/ 1.0 (hypot 1.0 (* (/ eh ew) (tan t)))) (* ew (cos t))) (* (* eh (sin t)) (sin (atan (/ (* eh (- (tan t))) ew)))))))
double code(double eh, double ew, double t) {
return fabs((((1.0 / hypot(1.0, ((eh / ew) * 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((((1.0 / Math.hypot(1.0, ((eh / ew) * 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((((1.0 / math.hypot(1.0, ((eh / ew) * 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(Float64(1.0 / hypot(1.0, Float64(Float64(eh / ew) * tan(t)))) * Float64(ew * cos(t))) - Float64(Float64(eh * sin(t)) * sin(atan(Float64(Float64(eh * Float64(-tan(t))) / ew)))))) end
function tmp = code(eh, ew, t) tmp = abs((((1.0 / hypot(1.0, ((eh / ew) * tan(t)))) * (ew * cos(t))) - ((eh * sin(t)) * sin(atan(((eh * -tan(t)) / ew)))))); end
code[eh_, ew_, t_] := N[Abs[N[(N[(N[(1.0 / N[Sqrt[1.0 ^ 2 + N[(N[(eh / ew), $MachinePrecision] * N[Tan[t], $MachinePrecision]), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision] * N[(ew * 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{1}{\mathsf{hypot}\left(1, \frac{eh}{ew} \cdot \tan t\right)} \cdot \left(ew \cdot \cos t\right) - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{eh \cdot \left(-\tan t\right)}{ew}\right)\right|
\end{array}
Initial program 99.8%
cos-atan31.7%
hypot-1-def31.7%
associate-/l*31.7%
associate-/r/31.7%
add-sqr-sqrt15.9%
sqrt-unprod31.7%
sqr-neg31.7%
sqrt-unprod15.8%
add-sqr-sqrt31.7%
Applied egg-rr99.8%
Final simplification99.8%
(FPCore (eh ew t) :precision binary64 (fabs (- (* (/ 1.0 (hypot 1.0 (* (/ eh ew) (tan t)))) (* ew (cos t))) (* (* eh (sin t)) (sin (atan (/ (* t (- eh)) ew)))))))
double code(double eh, double ew, double t) {
return fabs((((1.0 / hypot(1.0, ((eh / ew) * tan(t)))) * (ew * cos(t))) - ((eh * sin(t)) * sin(atan(((t * -eh) / ew))))));
}
public static double code(double eh, double ew, double t) {
return Math.abs((((1.0 / Math.hypot(1.0, ((eh / ew) * Math.tan(t)))) * (ew * Math.cos(t))) - ((eh * Math.sin(t)) * Math.sin(Math.atan(((t * -eh) / ew))))));
}
def code(eh, ew, t): return math.fabs((((1.0 / math.hypot(1.0, ((eh / ew) * math.tan(t)))) * (ew * math.cos(t))) - ((eh * math.sin(t)) * math.sin(math.atan(((t * -eh) / ew))))))
function code(eh, ew, t) return abs(Float64(Float64(Float64(1.0 / hypot(1.0, Float64(Float64(eh / ew) * tan(t)))) * Float64(ew * cos(t))) - Float64(Float64(eh * sin(t)) * sin(atan(Float64(Float64(t * Float64(-eh)) / ew)))))) end
function tmp = code(eh, ew, t) tmp = abs((((1.0 / hypot(1.0, ((eh / ew) * tan(t)))) * (ew * cos(t))) - ((eh * sin(t)) * sin(atan(((t * -eh) / ew)))))); end
code[eh_, ew_, t_] := N[Abs[N[(N[(N[(1.0 / N[Sqrt[1.0 ^ 2 + N[(N[(eh / ew), $MachinePrecision] * N[Tan[t], $MachinePrecision]), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision] * 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]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\left|\frac{1}{\mathsf{hypot}\left(1, \frac{eh}{ew} \cdot \tan t\right)} \cdot \left(ew \cdot \cos t\right) - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{t \cdot \left(-eh\right)}{ew}\right)\right|
\end{array}
Initial program 99.8%
cos-atan31.7%
hypot-1-def31.7%
associate-/l*31.7%
associate-/r/31.7%
add-sqr-sqrt15.9%
sqrt-unprod31.7%
sqr-neg31.7%
sqrt-unprod15.8%
add-sqr-sqrt31.7%
Applied egg-rr99.8%
Taylor expanded in t around 0 99.2%
associate-*r/31.6%
mul-1-neg31.6%
*-commutative31.6%
distribute-rgt-neg-in31.6%
Simplified99.2%
Final simplification99.2%
(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(Float64(eh * sin(t)) * sin(atan(Float64(Float64(eh * Float64(-tan(t))) / 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[(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|ew \cdot \cos t - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{eh \cdot \left(-\tan t\right)}{ew}\right)\right|
\end{array}
Initial program 99.8%
cos-atan31.7%
hypot-1-def31.7%
associate-/l*31.7%
associate-/r/31.7%
add-sqr-sqrt15.9%
sqrt-unprod31.7%
sqr-neg31.7%
sqrt-unprod15.8%
add-sqr-sqrt31.7%
Applied egg-rr99.8%
Taylor expanded in eh around 0 98.7%
Final simplification98.7%
(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(Float64(eh * sin(t)) * sin(atan(Float64(Float64(eh * tan(t)) / 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[(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|ew \cdot \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%
cos-atan31.7%
hypot-1-def31.7%
associate-/l*31.7%
associate-/r/31.7%
add-sqr-sqrt15.9%
sqrt-unprod31.7%
sqr-neg31.7%
sqrt-unprod15.8%
add-sqr-sqrt31.7%
Applied egg-rr99.8%
Taylor expanded in eh around 0 98.7%
add-log-exp88.3%
*-un-lft-identity88.3%
log-prod88.3%
metadata-eval88.3%
add-log-exp98.7%
add-sqr-sqrt50.2%
sqrt-unprod97.6%
sqr-neg97.6%
sqrt-unprod48.5%
add-sqr-sqrt98.7%
Applied egg-rr98.7%
+-lft-identity98.7%
*-commutative98.7%
Simplified98.7%
Final simplification98.7%
(FPCore (eh ew t) :precision binary64 (if (or (<= ew -1.5e+96) (not (<= ew 4.4e+77))) (fabs (- (* ew (cos t)) (* (sin (atan (/ (* t (- eh)) ew))) (* t eh)))) (fabs (- (* ew (cos (atan (/ (* eh (- (tan t))) ew)))) (* eh (sin t))))))
double code(double eh, double ew, double t) {
double tmp;
if ((ew <= -1.5e+96) || !(ew <= 4.4e+77)) {
tmp = fabs(((ew * cos(t)) - (sin(atan(((t * -eh) / ew))) * (t * eh))));
} else {
tmp = fabs(((ew * cos(atan(((eh * -tan(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 <= (-1.5d+96)) .or. (.not. (ew <= 4.4d+77))) then
tmp = abs(((ew * cos(t)) - (sin(atan(((t * -eh) / ew))) * (t * eh))))
else
tmp = abs(((ew * cos(atan(((eh * -tan(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 <= -1.5e+96) || !(ew <= 4.4e+77)) {
tmp = Math.abs(((ew * Math.cos(t)) - (Math.sin(Math.atan(((t * -eh) / ew))) * (t * eh))));
} else {
tmp = Math.abs(((ew * Math.cos(Math.atan(((eh * -Math.tan(t)) / ew)))) - (eh * Math.sin(t))));
}
return tmp;
}
def code(eh, ew, t): tmp = 0 if (ew <= -1.5e+96) or not (ew <= 4.4e+77): tmp = math.fabs(((ew * math.cos(t)) - (math.sin(math.atan(((t * -eh) / ew))) * (t * eh)))) else: tmp = math.fabs(((ew * math.cos(math.atan(((eh * -math.tan(t)) / ew)))) - (eh * math.sin(t)))) return tmp
function code(eh, ew, t) tmp = 0.0 if ((ew <= -1.5e+96) || !(ew <= 4.4e+77)) tmp = abs(Float64(Float64(ew * cos(t)) - Float64(sin(atan(Float64(Float64(t * Float64(-eh)) / ew))) * Float64(t * eh)))); else tmp = abs(Float64(Float64(ew * cos(atan(Float64(Float64(eh * Float64(-tan(t))) / ew)))) - Float64(eh * sin(t)))); end return tmp end
function tmp_2 = code(eh, ew, t) tmp = 0.0; if ((ew <= -1.5e+96) || ~((ew <= 4.4e+77))) tmp = abs(((ew * cos(t)) - (sin(atan(((t * -eh) / ew))) * (t * eh)))); else tmp = abs(((ew * cos(atan(((eh * -tan(t)) / ew)))) - (eh * sin(t)))); end tmp_2 = tmp; end
code[eh_, ew_, t_] := If[Or[LessEqual[ew, -1.5e+96], N[Not[LessEqual[ew, 4.4e+77]], $MachinePrecision]], N[Abs[N[(N[(ew * N[Cos[t], $MachinePrecision]), $MachinePrecision] - N[(N[Sin[N[ArcTan[N[(N[(t * (-eh)), $MachinePrecision] / ew), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * N[(t * eh), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Abs[N[(N[(ew * N[Cos[N[ArcTan[N[(N[(eh * (-N[Tan[t], $MachinePrecision])), $MachinePrecision] / ew), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - N[(eh * N[Sin[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;ew \leq -1.5 \cdot 10^{+96} \lor \neg \left(ew \leq 4.4 \cdot 10^{+77}\right):\\
\;\;\;\;\left|ew \cdot \cos t - \sin \tan^{-1} \left(\frac{t \cdot \left(-eh\right)}{ew}\right) \cdot \left(t \cdot eh\right)\right|\\
\mathbf{else}:\\
\;\;\;\;\left|ew \cdot \cos \tan^{-1} \left(\frac{eh \cdot \left(-\tan t\right)}{ew}\right) - eh \cdot \sin t\right|\\
\end{array}
\end{array}
if ew < -1.5e96 or 4.4000000000000001e77 < ew Initial program 99.7%
cos-atan39.3%
hypot-1-def39.3%
associate-/l*39.3%
associate-/r/39.3%
add-sqr-sqrt20.6%
sqrt-unprod39.3%
sqr-neg39.3%
sqrt-unprod18.7%
add-sqr-sqrt39.3%
Applied egg-rr99.7%
Taylor expanded in eh around 0 98.9%
Taylor expanded in t around 0 98.6%
associate-*r/39.3%
mul-1-neg39.3%
*-commutative39.3%
distribute-rgt-neg-in39.3%
Simplified98.6%
Taylor expanded in t around 0 84.5%
if -1.5e96 < ew < 4.4000000000000001e77Initial program 99.8%
Taylor expanded in t around 0 88.1%
sin-atan53.6%
associate-*r/53.3%
associate-/l*53.1%
add-sqr-sqrt27.6%
sqrt-unprod44.5%
sqr-neg44.5%
sqrt-unprod25.4%
add-sqr-sqrt52.7%
associate-/l*52.9%
associate-*l/49.7%
hypot-1-def56.3%
associate-/l*56.3%
add-sqr-sqrt28.7%
Applied egg-rr56.2%
associate-*l*56.1%
associate-*r*56.0%
*-commutative56.0%
Simplified56.0%
Taylor expanded in eh around inf 87.5%
Final simplification86.4%
(FPCore (eh ew t) :precision binary64 (if (or (<= ew -1.14e+95) (not (<= ew 4.05e+77))) (fabs (- (* ew (cos t)) (* (sin (atan (/ (* t (- eh)) ew))) (* t eh)))) (fabs (+ (* eh (sin t)) (* ew (cos (atan (/ (* eh (- (tan t))) ew))))))))
double code(double eh, double ew, double t) {
double tmp;
if ((ew <= -1.14e+95) || !(ew <= 4.05e+77)) {
tmp = fabs(((ew * cos(t)) - (sin(atan(((t * -eh) / ew))) * (t * eh))));
} else {
tmp = fabs(((eh * sin(t)) + (ew * 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) :: tmp
if ((ew <= (-1.14d+95)) .or. (.not. (ew <= 4.05d+77))) then
tmp = abs(((ew * cos(t)) - (sin(atan(((t * -eh) / ew))) * (t * eh))))
else
tmp = abs(((eh * sin(t)) + (ew * cos(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 <= -1.14e+95) || !(ew <= 4.05e+77)) {
tmp = Math.abs(((ew * Math.cos(t)) - (Math.sin(Math.atan(((t * -eh) / ew))) * (t * eh))));
} else {
tmp = Math.abs(((eh * Math.sin(t)) + (ew * Math.cos(Math.atan(((eh * -Math.tan(t)) / ew))))));
}
return tmp;
}
def code(eh, ew, t): tmp = 0 if (ew <= -1.14e+95) or not (ew <= 4.05e+77): tmp = math.fabs(((ew * math.cos(t)) - (math.sin(math.atan(((t * -eh) / ew))) * (t * eh)))) else: tmp = math.fabs(((eh * math.sin(t)) + (ew * math.cos(math.atan(((eh * -math.tan(t)) / ew)))))) return tmp
function code(eh, ew, t) tmp = 0.0 if ((ew <= -1.14e+95) || !(ew <= 4.05e+77)) tmp = abs(Float64(Float64(ew * cos(t)) - Float64(sin(atan(Float64(Float64(t * Float64(-eh)) / ew))) * Float64(t * eh)))); else tmp = abs(Float64(Float64(eh * sin(t)) + Float64(ew * cos(atan(Float64(Float64(eh * Float64(-tan(t))) / ew)))))); end return tmp end
function tmp_2 = code(eh, ew, t) tmp = 0.0; if ((ew <= -1.14e+95) || ~((ew <= 4.05e+77))) tmp = abs(((ew * cos(t)) - (sin(atan(((t * -eh) / ew))) * (t * eh)))); else tmp = abs(((eh * sin(t)) + (ew * cos(atan(((eh * -tan(t)) / ew)))))); end tmp_2 = tmp; end
code[eh_, ew_, t_] := If[Or[LessEqual[ew, -1.14e+95], N[Not[LessEqual[ew, 4.05e+77]], $MachinePrecision]], N[Abs[N[(N[(ew * N[Cos[t], $MachinePrecision]), $MachinePrecision] - N[(N[Sin[N[ArcTan[N[(N[(t * (-eh)), $MachinePrecision] / ew), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * N[(t * eh), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Abs[N[(N[(eh * N[Sin[t], $MachinePrecision]), $MachinePrecision] + N[(ew * N[Cos[N[ArcTan[N[(N[(eh * (-N[Tan[t], $MachinePrecision])), $MachinePrecision] / ew), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;ew \leq -1.14 \cdot 10^{+95} \lor \neg \left(ew \leq 4.05 \cdot 10^{+77}\right):\\
\;\;\;\;\left|ew \cdot \cos t - \sin \tan^{-1} \left(\frac{t \cdot \left(-eh\right)}{ew}\right) \cdot \left(t \cdot eh\right)\right|\\
\mathbf{else}:\\
\;\;\;\;\left|eh \cdot \sin t + ew \cdot \cos \tan^{-1} \left(\frac{eh \cdot \left(-\tan t\right)}{ew}\right)\right|\\
\end{array}
\end{array}
if ew < -1.14e95 or 4.04999999999999976e77 < ew Initial program 99.7%
cos-atan39.3%
hypot-1-def39.3%
associate-/l*39.3%
associate-/r/39.3%
add-sqr-sqrt20.6%
sqrt-unprod39.3%
sqr-neg39.3%
sqrt-unprod18.7%
add-sqr-sqrt39.3%
Applied egg-rr99.7%
Taylor expanded in eh around 0 98.9%
Taylor expanded in t around 0 98.6%
associate-*r/39.3%
mul-1-neg39.3%
*-commutative39.3%
distribute-rgt-neg-in39.3%
Simplified98.6%
Taylor expanded in t around 0 84.5%
if -1.14e95 < ew < 4.04999999999999976e77Initial program 99.8%
Taylor expanded in t around 0 88.1%
sin-atan53.6%
associate-*r/53.3%
associate-/l*53.1%
add-sqr-sqrt27.6%
sqrt-unprod44.5%
sqr-neg44.5%
sqrt-unprod25.4%
add-sqr-sqrt52.7%
associate-/l*52.9%
associate-*l/49.7%
hypot-1-def56.3%
associate-/l*56.3%
add-sqr-sqrt28.7%
Applied egg-rr56.2%
associate-*l*56.1%
associate-*r*56.0%
*-commutative56.0%
Simplified56.0%
Taylor expanded in eh around -inf 87.5%
mul-1-neg87.5%
distribute-rgt-neg-in87.5%
Simplified87.5%
Final simplification86.4%
(FPCore (eh ew t) :precision binary64 (fabs (- (* ew (cos t)) (* (* eh (sin t)) (sin (atan (/ (* t (- eh)) ew)))))))
double code(double eh, double ew, double t) {
return fabs(((ew * cos(t)) - ((eh * sin(t)) * sin(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 = abs(((ew * cos(t)) - ((eh * sin(t)) * sin(atan(((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(((t * -eh) / ew))))));
}
def code(eh, ew, t): return math.fabs(((ew * math.cos(t)) - ((eh * math.sin(t)) * math.sin(math.atan(((t * -eh) / ew))))))
function code(eh, ew, t) return abs(Float64(Float64(ew * cos(t)) - Float64(Float64(eh * sin(t)) * sin(atan(Float64(Float64(t * Float64(-eh)) / ew)))))) end
function tmp = code(eh, ew, t) tmp = abs(((ew * cos(t)) - ((eh * sin(t)) * sin(atan(((t * -eh) / ew)))))); end
code[eh_, ew_, t_] := N[Abs[N[(N[(ew * N[Cos[t], $MachinePrecision]), $MachinePrecision] - N[(N[(eh * N[Sin[t], $MachinePrecision]), $MachinePrecision] * N[Sin[N[ArcTan[N[(N[(t * (-eh)), $MachinePrecision] / ew), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\left|ew \cdot \cos t - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{t \cdot \left(-eh\right)}{ew}\right)\right|
\end{array}
Initial program 99.8%
cos-atan31.7%
hypot-1-def31.7%
associate-/l*31.7%
associate-/r/31.7%
add-sqr-sqrt15.9%
sqrt-unprod31.7%
sqr-neg31.7%
sqrt-unprod15.8%
add-sqr-sqrt31.7%
Applied egg-rr99.8%
Taylor expanded in eh around 0 98.7%
Taylor expanded in t around 0 98.4%
associate-*r/31.6%
mul-1-neg31.6%
*-commutative31.6%
distribute-rgt-neg-in31.6%
Simplified98.4%
Final simplification98.4%
(FPCore (eh ew t) :precision binary64 (fabs (- (* ew (cos t)) (* (* eh (sin t)) (sin (atan (* t (/ eh ew))))))))
double code(double eh, double ew, double t) {
return fabs(((ew * cos(t)) - ((eh * sin(t)) * sin(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 = abs(((ew * cos(t)) - ((eh * sin(t)) * sin(atan((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((t * (eh / ew)))))));
}
def code(eh, ew, t): return math.fabs(((ew * math.cos(t)) - ((eh * math.sin(t)) * math.sin(math.atan((t * (eh / ew)))))))
function code(eh, ew, t) return abs(Float64(Float64(ew * cos(t)) - Float64(Float64(eh * sin(t)) * sin(atan(Float64(t * Float64(eh / ew))))))) end
function tmp = code(eh, ew, t) tmp = abs(((ew * cos(t)) - ((eh * sin(t)) * sin(atan((t * (eh / ew))))))); end
code[eh_, ew_, t_] := N[Abs[N[(N[(ew * N[Cos[t], $MachinePrecision]), $MachinePrecision] - N[(N[(eh * N[Sin[t], $MachinePrecision]), $MachinePrecision] * N[Sin[N[ArcTan[N[(t * N[(eh / ew), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\left|ew \cdot \cos t - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(t \cdot \frac{eh}{ew}\right)\right|
\end{array}
Initial program 99.8%
cos-atan31.7%
hypot-1-def31.7%
associate-/l*31.7%
associate-/r/31.7%
add-sqr-sqrt15.9%
sqrt-unprod31.7%
sqr-neg31.7%
sqrt-unprod15.8%
add-sqr-sqrt31.7%
Applied egg-rr99.8%
Taylor expanded in eh around 0 98.7%
Taylor expanded in t around 0 98.4%
associate-*r/31.6%
mul-1-neg31.6%
*-commutative31.6%
distribute-rgt-neg-in31.6%
Simplified98.4%
expm1-log1p-u79.6%
expm1-udef68.9%
associate-/l*69.3%
add-sqr-sqrt37.3%
sqrt-unprod69.0%
sqr-neg69.0%
sqrt-unprod32.9%
add-sqr-sqrt70.8%
Applied egg-rr70.8%
expm1-def81.6%
expm1-log1p98.4%
*-commutative98.4%
associate-/r/98.4%
Simplified98.4%
Final simplification98.4%
(FPCore (eh ew t)
:precision binary64
(let* ((t_1 (sin (atan (/ (* t (- eh)) ew)))))
(if (or (<= ew -3.6e+95) (not (<= ew 7.2e+76)))
(fabs (- (* ew (cos t)) (* t_1 (* t eh))))
(fabs (- ew (* (* eh (sin t)) t_1))))))
double code(double eh, double ew, double t) {
double t_1 = sin(atan(((t * -eh) / ew)));
double tmp;
if ((ew <= -3.6e+95) || !(ew <= 7.2e+76)) {
tmp = fabs(((ew * cos(t)) - (t_1 * (t * eh))));
} else {
tmp = fabs((ew - ((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(((t * -eh) / ew)))
if ((ew <= (-3.6d+95)) .or. (.not. (ew <= 7.2d+76))) then
tmp = abs(((ew * cos(t)) - (t_1 * (t * eh))))
else
tmp = abs((ew - ((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(((t * -eh) / ew)));
double tmp;
if ((ew <= -3.6e+95) || !(ew <= 7.2e+76)) {
tmp = Math.abs(((ew * Math.cos(t)) - (t_1 * (t * eh))));
} else {
tmp = Math.abs((ew - ((eh * Math.sin(t)) * t_1)));
}
return tmp;
}
def code(eh, ew, t): t_1 = math.sin(math.atan(((t * -eh) / ew))) tmp = 0 if (ew <= -3.6e+95) or not (ew <= 7.2e+76): tmp = math.fabs(((ew * math.cos(t)) - (t_1 * (t * eh)))) else: tmp = math.fabs((ew - ((eh * math.sin(t)) * t_1))) return tmp
function code(eh, ew, t) t_1 = sin(atan(Float64(Float64(t * Float64(-eh)) / ew))) tmp = 0.0 if ((ew <= -3.6e+95) || !(ew <= 7.2e+76)) tmp = abs(Float64(Float64(ew * cos(t)) - Float64(t_1 * Float64(t * eh)))); else tmp = abs(Float64(ew - Float64(Float64(eh * sin(t)) * t_1))); end return tmp end
function tmp_2 = code(eh, ew, t) t_1 = sin(atan(((t * -eh) / ew))); tmp = 0.0; if ((ew <= -3.6e+95) || ~((ew <= 7.2e+76))) tmp = abs(((ew * cos(t)) - (t_1 * (t * eh)))); else tmp = abs((ew - ((eh * sin(t)) * t_1))); end tmp_2 = tmp; end
code[eh_, ew_, t_] := Block[{t$95$1 = N[Sin[N[ArcTan[N[(N[(t * (-eh)), $MachinePrecision] / ew), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]}, If[Or[LessEqual[ew, -3.6e+95], N[Not[LessEqual[ew, 7.2e+76]], $MachinePrecision]], N[Abs[N[(N[(ew * N[Cos[t], $MachinePrecision]), $MachinePrecision] - N[(t$95$1 * N[(t * eh), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Abs[N[(ew - N[(N[(eh * N[Sin[t], $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \sin \tan^{-1} \left(\frac{t \cdot \left(-eh\right)}{ew}\right)\\
\mathbf{if}\;ew \leq -3.6 \cdot 10^{+95} \lor \neg \left(ew \leq 7.2 \cdot 10^{+76}\right):\\
\;\;\;\;\left|ew \cdot \cos t - t_1 \cdot \left(t \cdot eh\right)\right|\\
\mathbf{else}:\\
\;\;\;\;\left|ew - \left(eh \cdot \sin t\right) \cdot t_1\right|\\
\end{array}
\end{array}
if ew < -3.59999999999999978e95 or 7.2000000000000006e76 < ew Initial program 99.7%
cos-atan39.3%
hypot-1-def39.3%
associate-/l*39.3%
associate-/r/39.3%
add-sqr-sqrt20.6%
sqrt-unprod39.3%
sqr-neg39.3%
sqrt-unprod18.7%
add-sqr-sqrt39.3%
Applied egg-rr99.7%
Taylor expanded in eh around 0 98.9%
Taylor expanded in t around 0 98.6%
associate-*r/39.3%
mul-1-neg39.3%
*-commutative39.3%
distribute-rgt-neg-in39.3%
Simplified98.6%
Taylor expanded in t around 0 84.5%
if -3.59999999999999978e95 < ew < 7.2000000000000006e76Initial program 99.8%
cos-atan27.3%
hypot-1-def27.3%
associate-/l*27.3%
associate-/r/27.3%
add-sqr-sqrt13.2%
sqrt-unprod27.3%
sqr-neg27.3%
sqrt-unprod14.1%
add-sqr-sqrt27.3%
Applied egg-rr99.8%
Taylor expanded in eh around 0 98.5%
Taylor expanded in t around 0 98.3%
associate-*r/27.2%
mul-1-neg27.2%
*-commutative27.2%
distribute-rgt-neg-in27.2%
Simplified98.3%
Taylor expanded in t around 0 87.1%
Final simplification86.1%
(FPCore (eh ew t) :precision binary64 (fabs (- ew (* (* eh (sin t)) (sin (atan (/ (* t (- eh)) ew)))))))
double code(double eh, double ew, double t) {
return fabs((ew - ((eh * sin(t)) * sin(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 = abs((ew - ((eh * sin(t)) * sin(atan(((t * -eh) / 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(((t * -eh) / ew))))));
}
def code(eh, ew, t): return math.fabs((ew - ((eh * math.sin(t)) * math.sin(math.atan(((t * -eh) / ew))))))
function code(eh, ew, t) return abs(Float64(ew - Float64(Float64(eh * sin(t)) * sin(atan(Float64(Float64(t * Float64(-eh)) / ew)))))) end
function tmp = code(eh, ew, t) tmp = abs((ew - ((eh * sin(t)) * sin(atan(((t * -eh) / ew)))))); end
code[eh_, ew_, t_] := N[Abs[N[(ew - N[(N[(eh * N[Sin[t], $MachinePrecision]), $MachinePrecision] * N[Sin[N[ArcTan[N[(N[(t * (-eh)), $MachinePrecision] / ew), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\left|ew - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{t \cdot \left(-eh\right)}{ew}\right)\right|
\end{array}
Initial program 99.8%
cos-atan31.7%
hypot-1-def31.7%
associate-/l*31.7%
associate-/r/31.7%
add-sqr-sqrt15.9%
sqrt-unprod31.7%
sqr-neg31.7%
sqrt-unprod15.8%
add-sqr-sqrt31.7%
Applied egg-rr99.8%
Taylor expanded in eh around 0 98.7%
Taylor expanded in t around 0 98.4%
associate-*r/31.6%
mul-1-neg31.6%
*-commutative31.6%
distribute-rgt-neg-in31.6%
Simplified98.4%
Taylor expanded in t around 0 77.0%
Final simplification77.0%
(FPCore (eh ew t) :precision binary64 (fabs (+ (/ (* t t) (/ ew (* eh eh))) (* ew (/ -1.0 (hypot 1.0 (* (/ eh ew) (tan t))))))))
double code(double eh, double ew, double t) {
return fabs((((t * t) / (ew / (eh * eh))) + (ew * (-1.0 / hypot(1.0, ((eh / ew) * tan(t)))))));
}
public static double code(double eh, double ew, double t) {
return Math.abs((((t * t) / (ew / (eh * eh))) + (ew * (-1.0 / Math.hypot(1.0, ((eh / ew) * Math.tan(t)))))));
}
def code(eh, ew, t): return math.fabs((((t * t) / (ew / (eh * eh))) + (ew * (-1.0 / math.hypot(1.0, ((eh / ew) * math.tan(t)))))))
function code(eh, ew, t) return abs(Float64(Float64(Float64(t * t) / Float64(ew / Float64(eh * eh))) + Float64(ew * Float64(-1.0 / hypot(1.0, Float64(Float64(eh / ew) * tan(t))))))) end
function tmp = code(eh, ew, t) tmp = abs((((t * t) / (ew / (eh * eh))) + (ew * (-1.0 / hypot(1.0, ((eh / ew) * tan(t))))))); end
code[eh_, ew_, t_] := N[Abs[N[(N[(N[(t * t), $MachinePrecision] / N[(ew / N[(eh * eh), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(ew * N[(-1.0 / N[Sqrt[1.0 ^ 2 + N[(N[(eh / ew), $MachinePrecision] * N[Tan[t], $MachinePrecision]), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\left|\frac{t \cdot t}{\frac{ew}{eh \cdot eh}} + ew \cdot \frac{-1}{\mathsf{hypot}\left(1, \frac{eh}{ew} \cdot \tan t\right)}\right|
\end{array}
Initial program 99.8%
Taylor expanded in t around 0 77.7%
sin-atan55.9%
associate-*r/54.6%
associate-/l*54.5%
add-sqr-sqrt27.5%
sqrt-unprod44.0%
sqr-neg44.0%
sqrt-unprod26.9%
add-sqr-sqrt54.3%
associate-/l*54.4%
associate-*l/52.4%
hypot-1-def56.5%
associate-/l*56.5%
add-sqr-sqrt28.2%
Applied egg-rr56.5%
associate-*l*56.4%
associate-*r*56.4%
*-commutative56.4%
Simplified56.4%
Taylor expanded in t around 0 31.8%
associate-/l*31.7%
unpow231.7%
unpow231.7%
Simplified31.7%
cos-atan31.7%
hypot-1-def31.7%
associate-/l*31.7%
associate-/r/31.7%
add-sqr-sqrt15.9%
sqrt-unprod31.7%
sqr-neg31.7%
sqrt-unprod15.8%
add-sqr-sqrt31.7%
Applied egg-rr31.7%
Final simplification31.7%
(FPCore (eh ew t) :precision binary64 (fabs (- (* ew (cos (atan (/ (* t (- eh)) ew)))) (/ (* t t) (/ ew (* eh eh))))))
double code(double eh, double ew, double t) {
return fabs(((ew * cos(atan(((t * -eh) / ew)))) - ((t * t) / (ew / (eh * eh)))));
}
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(((t * -eh) / ew)))) - ((t * t) / (ew / (eh * eh)))))
end function
public static double code(double eh, double ew, double t) {
return Math.abs(((ew * Math.cos(Math.atan(((t * -eh) / ew)))) - ((t * t) / (ew / (eh * eh)))));
}
def code(eh, ew, t): return math.fabs(((ew * math.cos(math.atan(((t * -eh) / ew)))) - ((t * t) / (ew / (eh * eh)))))
function code(eh, ew, t) return abs(Float64(Float64(ew * cos(atan(Float64(Float64(t * Float64(-eh)) / ew)))) - Float64(Float64(t * t) / Float64(ew / Float64(eh * eh))))) end
function tmp = code(eh, ew, t) tmp = abs(((ew * cos(atan(((t * -eh) / ew)))) - ((t * t) / (ew / (eh * eh))))); end
code[eh_, ew_, t_] := N[Abs[N[(N[(ew * N[Cos[N[ArcTan[N[(N[(t * (-eh)), $MachinePrecision] / ew), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - N[(N[(t * t), $MachinePrecision] / N[(ew / N[(eh * eh), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\left|ew \cdot \cos \tan^{-1} \left(\frac{t \cdot \left(-eh\right)}{ew}\right) - \frac{t \cdot t}{\frac{ew}{eh \cdot eh}}\right|
\end{array}
Initial program 99.8%
Taylor expanded in t around 0 77.7%
sin-atan55.9%
associate-*r/54.6%
associate-/l*54.5%
add-sqr-sqrt27.5%
sqrt-unprod44.0%
sqr-neg44.0%
sqrt-unprod26.9%
add-sqr-sqrt54.3%
associate-/l*54.4%
associate-*l/52.4%
hypot-1-def56.5%
associate-/l*56.5%
add-sqr-sqrt28.2%
Applied egg-rr56.5%
associate-*l*56.4%
associate-*r*56.4%
*-commutative56.4%
Simplified56.4%
Taylor expanded in t around 0 31.8%
associate-/l*31.7%
unpow231.7%
unpow231.7%
Simplified31.7%
Taylor expanded in t around 0 31.6%
associate-*r/31.6%
mul-1-neg31.6%
*-commutative31.6%
distribute-rgt-neg-in31.6%
Simplified31.6%
Final simplification31.6%
herbie shell --seed 2023207
(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)))))))