
(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 (fabs (- (* ew (* (cos t) (/ 1.0 (hypot 1.0 (* (tan t) (/ eh ew)))))) (* eh (* (sin t) (sin (atan (/ (- eh) (/ ew (tan t))))))))))
double code(double eh, double ew, double t) {
return fabs(((ew * (cos(t) * (1.0 / hypot(1.0, (tan(t) * (eh / ew)))))) - (eh * (sin(t) * sin(atan((-eh / (ew / tan(t)))))))));
}
public static double code(double eh, double ew, double t) {
return Math.abs(((ew * (Math.cos(t) * (1.0 / Math.hypot(1.0, (Math.tan(t) * (eh / ew)))))) - (eh * (Math.sin(t) * Math.sin(Math.atan((-eh / (ew / Math.tan(t)))))))));
}
def code(eh, ew, t): return math.fabs(((ew * (math.cos(t) * (1.0 / math.hypot(1.0, (math.tan(t) * (eh / ew)))))) - (eh * (math.sin(t) * math.sin(math.atan((-eh / (ew / math.tan(t)))))))))
function code(eh, ew, t) return abs(Float64(Float64(ew * Float64(cos(t) * Float64(1.0 / hypot(1.0, Float64(tan(t) * Float64(eh / ew)))))) - Float64(eh * Float64(sin(t) * sin(atan(Float64(Float64(-eh) / Float64(ew / tan(t))))))))) end
function tmp = code(eh, ew, t) tmp = abs(((ew * (cos(t) * (1.0 / hypot(1.0, (tan(t) * (eh / ew)))))) - (eh * (sin(t) * sin(atan((-eh / (ew / tan(t))))))))); end
code[eh_, ew_, t_] := N[Abs[N[(N[(ew * N[(N[Cos[t], $MachinePrecision] * N[(1.0 / N[Sqrt[1.0 ^ 2 + N[(N[Tan[t], $MachinePrecision] * N[(eh / ew), $MachinePrecision]), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(eh * N[(N[Sin[t], $MachinePrecision] * N[Sin[N[ArcTan[N[((-eh) / N[(ew / N[Tan[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\left|ew \cdot \left(\cos t \cdot \frac{1}{\mathsf{hypot}\left(1, \tan t \cdot \frac{eh}{ew}\right)}\right) - eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\frac{-eh}{\frac{ew}{\tan t}}\right)\right)\right|
\end{array}
Initial program 99.8%
fabs-neg99.8%
sub0-neg99.8%
sub-neg99.8%
+-commutative99.8%
associate--r+99.8%
Simplified99.8%
cos-atan99.8%
hypot-1-def99.8%
div-inv99.8%
add-sqr-sqrt48.7%
sqrt-unprod95.5%
sqr-neg95.5%
sqrt-unprod51.1%
add-sqr-sqrt99.8%
clear-num99.8%
Applied egg-rr99.8%
*-commutative99.8%
associate-*l/99.8%
associate-*r/99.8%
Simplified99.8%
Final simplification99.8%
(FPCore (eh ew t)
:precision binary64
(let* ((t_1 (atan (/ (- t) (/ ew eh)))))
(if (<= ew -1.55e-105)
(fabs
(-
(* ew (* (cos t) (/ 1.0 (hypot 1.0 (* (tan t) (/ eh ew))))))
(*
eh
(*
(sin t)
(sin (atan (/ eh (* ew (+ (* t 0.3333333333333333) (/ -1.0 t))))))))))
(if (<= ew 5.1e-100)
(fabs (- (* ew (* (cos t) (cos t_1))) (* eh (* (sin t) (sin t_1)))))
(fabs
(-
(* ew (cos t))
(*
eh
(*
(sin t)
(sin
(atan
(/ (- eh) (+ (* -0.3333333333333333 (* ew t)) (/ ew t)))))))))))))
double code(double eh, double ew, double t) {
double t_1 = atan((-t / (ew / eh)));
double tmp;
if (ew <= -1.55e-105) {
tmp = fabs(((ew * (cos(t) * (1.0 / hypot(1.0, (tan(t) * (eh / ew)))))) - (eh * (sin(t) * sin(atan((eh / (ew * ((t * 0.3333333333333333) + (-1.0 / t))))))))));
} else if (ew <= 5.1e-100) {
tmp = fabs(((ew * (cos(t) * cos(t_1))) - (eh * (sin(t) * sin(t_1)))));
} else {
tmp = fabs(((ew * cos(t)) - (eh * (sin(t) * sin(atan((-eh / ((-0.3333333333333333 * (ew * t)) + (ew / t)))))))));
}
return tmp;
}
public static double code(double eh, double ew, double t) {
double t_1 = Math.atan((-t / (ew / eh)));
double tmp;
if (ew <= -1.55e-105) {
tmp = Math.abs(((ew * (Math.cos(t) * (1.0 / Math.hypot(1.0, (Math.tan(t) * (eh / ew)))))) - (eh * (Math.sin(t) * Math.sin(Math.atan((eh / (ew * ((t * 0.3333333333333333) + (-1.0 / t))))))))));
} else if (ew <= 5.1e-100) {
tmp = Math.abs(((ew * (Math.cos(t) * Math.cos(t_1))) - (eh * (Math.sin(t) * Math.sin(t_1)))));
} else {
tmp = Math.abs(((ew * Math.cos(t)) - (eh * (Math.sin(t) * Math.sin(Math.atan((-eh / ((-0.3333333333333333 * (ew * t)) + (ew / t)))))))));
}
return tmp;
}
def code(eh, ew, t): t_1 = math.atan((-t / (ew / eh))) tmp = 0 if ew <= -1.55e-105: tmp = math.fabs(((ew * (math.cos(t) * (1.0 / math.hypot(1.0, (math.tan(t) * (eh / ew)))))) - (eh * (math.sin(t) * math.sin(math.atan((eh / (ew * ((t * 0.3333333333333333) + (-1.0 / t)))))))))) elif ew <= 5.1e-100: tmp = math.fabs(((ew * (math.cos(t) * math.cos(t_1))) - (eh * (math.sin(t) * math.sin(t_1))))) else: tmp = math.fabs(((ew * math.cos(t)) - (eh * (math.sin(t) * math.sin(math.atan((-eh / ((-0.3333333333333333 * (ew * t)) + (ew / t))))))))) return tmp
function code(eh, ew, t) t_1 = atan(Float64(Float64(-t) / Float64(ew / eh))) tmp = 0.0 if (ew <= -1.55e-105) tmp = abs(Float64(Float64(ew * Float64(cos(t) * Float64(1.0 / hypot(1.0, Float64(tan(t) * Float64(eh / ew)))))) - Float64(eh * Float64(sin(t) * sin(atan(Float64(eh / Float64(ew * Float64(Float64(t * 0.3333333333333333) + Float64(-1.0 / t)))))))))); elseif (ew <= 5.1e-100) tmp = abs(Float64(Float64(ew * Float64(cos(t) * cos(t_1))) - Float64(eh * Float64(sin(t) * sin(t_1))))); else tmp = abs(Float64(Float64(ew * cos(t)) - Float64(eh * Float64(sin(t) * sin(atan(Float64(Float64(-eh) / Float64(Float64(-0.3333333333333333 * Float64(ew * t)) + Float64(ew / t))))))))); end return tmp end
function tmp_2 = code(eh, ew, t) t_1 = atan((-t / (ew / eh))); tmp = 0.0; if (ew <= -1.55e-105) tmp = abs(((ew * (cos(t) * (1.0 / hypot(1.0, (tan(t) * (eh / ew)))))) - (eh * (sin(t) * sin(atan((eh / (ew * ((t * 0.3333333333333333) + (-1.0 / t)))))))))); elseif (ew <= 5.1e-100) tmp = abs(((ew * (cos(t) * cos(t_1))) - (eh * (sin(t) * sin(t_1))))); else tmp = abs(((ew * cos(t)) - (eh * (sin(t) * sin(atan((-eh / ((-0.3333333333333333 * (ew * t)) + (ew / t))))))))); end tmp_2 = tmp; end
code[eh_, ew_, t_] := Block[{t$95$1 = N[ArcTan[N[((-t) / N[(ew / eh), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[ew, -1.55e-105], N[Abs[N[(N[(ew * N[(N[Cos[t], $MachinePrecision] * N[(1.0 / N[Sqrt[1.0 ^ 2 + N[(N[Tan[t], $MachinePrecision] * N[(eh / ew), $MachinePrecision]), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(eh * N[(N[Sin[t], $MachinePrecision] * N[Sin[N[ArcTan[N[(eh / N[(ew * N[(N[(t * 0.3333333333333333), $MachinePrecision] + N[(-1.0 / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[ew, 5.1e-100], N[Abs[N[(N[(ew * N[(N[Cos[t], $MachinePrecision] * N[Cos[t$95$1], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(eh * N[(N[Sin[t], $MachinePrecision] * N[Sin[t$95$1], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Abs[N[(N[(ew * N[Cos[t], $MachinePrecision]), $MachinePrecision] - N[(eh * N[(N[Sin[t], $MachinePrecision] * N[Sin[N[ArcTan[N[((-eh) / N[(N[(-0.3333333333333333 * N[(ew * t), $MachinePrecision]), $MachinePrecision] + N[(ew / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \tan^{-1} \left(\frac{-t}{\frac{ew}{eh}}\right)\\
\mathbf{if}\;ew \leq -1.55 \cdot 10^{-105}:\\
\;\;\;\;\left|ew \cdot \left(\cos t \cdot \frac{1}{\mathsf{hypot}\left(1, \tan t \cdot \frac{eh}{ew}\right)}\right) - eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\frac{eh}{ew \cdot \left(t \cdot 0.3333333333333333 + \frac{-1}{t}\right)}\right)\right)\right|\\
\mathbf{elif}\;ew \leq 5.1 \cdot 10^{-100}:\\
\;\;\;\;\left|ew \cdot \left(\cos t \cdot \cos t_1\right) - eh \cdot \left(\sin t \cdot \sin t_1\right)\right|\\
\mathbf{else}:\\
\;\;\;\;\left|ew \cdot \cos t - eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\frac{-eh}{-0.3333333333333333 \cdot \left(ew \cdot t\right) + \frac{ew}{t}}\right)\right)\right|\\
\end{array}
\end{array}
if ew < -1.55000000000000007e-105Initial program 99.7%
fabs-neg99.7%
sub0-neg99.7%
sub-neg99.7%
+-commutative99.7%
associate--r+99.7%
Simplified99.7%
cos-atan99.7%
hypot-1-def99.7%
div-inv99.7%
add-sqr-sqrt48.0%
sqrt-unprod97.3%
sqr-neg97.3%
sqrt-unprod51.7%
add-sqr-sqrt99.7%
clear-num99.7%
Applied egg-rr99.7%
*-commutative99.7%
associate-*l/99.7%
associate-*r/99.7%
Simplified99.7%
Taylor expanded in t around 0 94.6%
Taylor expanded in ew around -inf 94.6%
if -1.55000000000000007e-105 < ew < 5.0999999999999999e-100Initial program 99.8%
fabs-neg99.8%
sub0-neg99.8%
sub-neg99.8%
+-commutative99.8%
associate--r+99.8%
Simplified99.8%
Taylor expanded in t around 0 98.9%
mul-1-neg29.0%
associate-/l*29.0%
distribute-neg-frac29.0%
Simplified98.9%
Taylor expanded in t around 0 98.9%
mul-1-neg29.0%
associate-/l*29.0%
distribute-neg-frac29.0%
Simplified98.9%
if 5.0999999999999999e-100 < ew Initial program 99.8%
fabs-neg99.8%
sub0-neg99.8%
sub-neg99.8%
+-commutative99.8%
associate--r+99.8%
Simplified99.8%
cos-atan99.8%
hypot-1-def99.8%
div-inv99.8%
add-sqr-sqrt48.6%
sqrt-unprod89.1%
sqr-neg89.1%
sqrt-unprod51.2%
add-sqr-sqrt99.8%
clear-num99.8%
Applied egg-rr99.8%
*-commutative99.8%
associate-*l/99.8%
associate-*r/99.8%
Simplified99.8%
Taylor expanded in t around 0 92.3%
Taylor expanded in t around 0 92.4%
Taylor expanded in ew around 0 92.4%
Final simplification95.5%
(FPCore (eh ew t)
:precision binary64
(let* ((t_1 (atan (/ (- t) (/ ew eh)))))
(if (or (<= ew -1.55e-105) (not (<= ew 1.9e-99)))
(fabs
(-
(* ew (cos t))
(*
eh
(*
(sin t)
(sin
(atan (/ (- eh) (+ (* -0.3333333333333333 (* ew t)) (/ ew t)))))))))
(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((-t / (ew / eh)));
double tmp;
if ((ew <= -1.55e-105) || !(ew <= 1.9e-99)) {
tmp = fabs(((ew * cos(t)) - (eh * (sin(t) * sin(atan((-eh / ((-0.3333333333333333 * (ew * t)) + (ew / t)))))))));
} else {
tmp = fabs(((ew * (cos(t) * cos(t_1))) - (eh * (sin(t) * sin(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 = atan((-t / (ew / eh)))
if ((ew <= (-1.55d-105)) .or. (.not. (ew <= 1.9d-99))) then
tmp = abs(((ew * cos(t)) - (eh * (sin(t) * sin(atan((-eh / (((-0.3333333333333333d0) * (ew * t)) + (ew / t)))))))))
else
tmp = abs(((ew * (cos(t) * cos(t_1))) - (eh * (sin(t) * sin(t_1)))))
end if
code = tmp
end function
public static double code(double eh, double ew, double t) {
double t_1 = Math.atan((-t / (ew / eh)));
double tmp;
if ((ew <= -1.55e-105) || !(ew <= 1.9e-99)) {
tmp = Math.abs(((ew * Math.cos(t)) - (eh * (Math.sin(t) * Math.sin(Math.atan((-eh / ((-0.3333333333333333 * (ew * t)) + (ew / t)))))))));
} else {
tmp = Math.abs(((ew * (Math.cos(t) * Math.cos(t_1))) - (eh * (Math.sin(t) * Math.sin(t_1)))));
}
return tmp;
}
def code(eh, ew, t): t_1 = math.atan((-t / (ew / eh))) tmp = 0 if (ew <= -1.55e-105) or not (ew <= 1.9e-99): tmp = math.fabs(((ew * math.cos(t)) - (eh * (math.sin(t) * math.sin(math.atan((-eh / ((-0.3333333333333333 * (ew * t)) + (ew / t))))))))) else: tmp = math.fabs(((ew * (math.cos(t) * math.cos(t_1))) - (eh * (math.sin(t) * math.sin(t_1))))) return tmp
function code(eh, ew, t) t_1 = atan(Float64(Float64(-t) / Float64(ew / eh))) tmp = 0.0 if ((ew <= -1.55e-105) || !(ew <= 1.9e-99)) tmp = abs(Float64(Float64(ew * cos(t)) - Float64(eh * Float64(sin(t) * sin(atan(Float64(Float64(-eh) / Float64(Float64(-0.3333333333333333 * Float64(ew * t)) + Float64(ew / t))))))))); else tmp = abs(Float64(Float64(ew * Float64(cos(t) * cos(t_1))) - Float64(eh * Float64(sin(t) * sin(t_1))))); end return tmp end
function tmp_2 = code(eh, ew, t) t_1 = atan((-t / (ew / eh))); tmp = 0.0; if ((ew <= -1.55e-105) || ~((ew <= 1.9e-99))) tmp = abs(((ew * cos(t)) - (eh * (sin(t) * sin(atan((-eh / ((-0.3333333333333333 * (ew * t)) + (ew / t))))))))); else tmp = abs(((ew * (cos(t) * cos(t_1))) - (eh * (sin(t) * sin(t_1))))); end tmp_2 = tmp; end
code[eh_, ew_, t_] := Block[{t$95$1 = N[ArcTan[N[((-t) / N[(ew / eh), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[Or[LessEqual[ew, -1.55e-105], N[Not[LessEqual[ew, 1.9e-99]], $MachinePrecision]], N[Abs[N[(N[(ew * N[Cos[t], $MachinePrecision]), $MachinePrecision] - N[(eh * N[(N[Sin[t], $MachinePrecision] * N[Sin[N[ArcTan[N[((-eh) / N[(N[(-0.3333333333333333 * N[(ew * t), $MachinePrecision]), $MachinePrecision] + N[(ew / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Abs[N[(N[(ew * N[(N[Cos[t], $MachinePrecision] * N[Cos[t$95$1], $MachinePrecision]), $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(\frac{-t}{\frac{ew}{eh}}\right)\\
\mathbf{if}\;ew \leq -1.55 \cdot 10^{-105} \lor \neg \left(ew \leq 1.9 \cdot 10^{-99}\right):\\
\;\;\;\;\left|ew \cdot \cos t - eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\frac{-eh}{-0.3333333333333333 \cdot \left(ew \cdot t\right) + \frac{ew}{t}}\right)\right)\right|\\
\mathbf{else}:\\
\;\;\;\;\left|ew \cdot \left(\cos t \cdot \cos t_1\right) - eh \cdot \left(\sin t \cdot \sin t_1\right)\right|\\
\end{array}
\end{array}
if ew < -1.55000000000000007e-105 or 1.8999999999999998e-99 < ew Initial program 99.8%
fabs-neg99.8%
sub0-neg99.8%
sub-neg99.8%
+-commutative99.8%
associate--r+99.8%
Simplified99.8%
cos-atan99.8%
hypot-1-def99.8%
div-inv99.8%
add-sqr-sqrt48.3%
sqrt-unprod93.2%
sqr-neg93.2%
sqrt-unprod51.5%
add-sqr-sqrt99.8%
clear-num99.8%
Applied egg-rr99.8%
*-commutative99.8%
associate-*l/99.8%
associate-*r/99.8%
Simplified99.8%
Taylor expanded in t around 0 93.5%
Taylor expanded in t around 0 93.1%
Taylor expanded in ew around 0 93.1%
if -1.55000000000000007e-105 < ew < 1.8999999999999998e-99Initial program 99.8%
fabs-neg99.8%
sub0-neg99.8%
sub-neg99.8%
+-commutative99.8%
associate--r+99.8%
Simplified99.8%
Taylor expanded in t around 0 98.9%
mul-1-neg29.0%
associate-/l*29.0%
distribute-neg-frac29.0%
Simplified98.9%
Taylor expanded in t around 0 98.9%
mul-1-neg29.0%
associate-/l*29.0%
distribute-neg-frac29.0%
Simplified98.9%
Final simplification95.3%
(FPCore (eh ew t)
:precision binary64
(fabs
(-
(* ew (cos t))
(*
eh
(*
(sin t)
(sin (atan (/ (- eh) (+ (* -0.3333333333333333 (* ew t)) (/ ew t))))))))))
double code(double eh, double ew, double t) {
return fabs(((ew * cos(t)) - (eh * (sin(t) * sin(atan((-eh / ((-0.3333333333333333 * (ew * t)) + (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(t)) - (eh * (sin(t) * sin(atan((-eh / (((-0.3333333333333333d0) * (ew * t)) + (ew / t)))))))))
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 / ((-0.3333333333333333 * (ew * t)) + (ew / t)))))))));
}
def code(eh, ew, t): return math.fabs(((ew * math.cos(t)) - (eh * (math.sin(t) * math.sin(math.atan((-eh / ((-0.3333333333333333 * (ew * t)) + (ew / t)))))))))
function code(eh, ew, t) return abs(Float64(Float64(ew * cos(t)) - Float64(eh * Float64(sin(t) * sin(atan(Float64(Float64(-eh) / Float64(Float64(-0.3333333333333333 * Float64(ew * t)) + Float64(ew / t))))))))) end
function tmp = code(eh, ew, t) tmp = abs(((ew * cos(t)) - (eh * (sin(t) * sin(atan((-eh / ((-0.3333333333333333 * (ew * t)) + (ew / t))))))))); end
code[eh_, ew_, t_] := N[Abs[N[(N[(ew * N[Cos[t], $MachinePrecision]), $MachinePrecision] - N[(eh * N[(N[Sin[t], $MachinePrecision] * N[Sin[N[ArcTan[N[((-eh) / N[(N[(-0.3333333333333333 * N[(ew * t), $MachinePrecision]), $MachinePrecision] + N[(ew / t), $MachinePrecision]), $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(\frac{-eh}{-0.3333333333333333 \cdot \left(ew \cdot t\right) + \frac{ew}{t}}\right)\right)\right|
\end{array}
Initial program 99.8%
fabs-neg99.8%
sub0-neg99.8%
sub-neg99.8%
+-commutative99.8%
associate--r+99.8%
Simplified99.8%
cos-atan99.8%
hypot-1-def99.8%
div-inv99.8%
add-sqr-sqrt48.7%
sqrt-unprod95.5%
sqr-neg95.5%
sqrt-unprod51.1%
add-sqr-sqrt99.8%
clear-num99.8%
Applied egg-rr99.8%
*-commutative99.8%
associate-*l/99.8%
associate-*r/99.8%
Simplified99.8%
Taylor expanded in t around 0 89.4%
Taylor expanded in t around 0 88.7%
Taylor expanded in ew around 0 88.7%
Final simplification88.7%
(FPCore (eh ew t) :precision binary64 (fabs (- (* ew (cos t)) (* eh (* (sin t) (sin (atan (* 3.0 (/ (/ eh t) ew)))))))))
double code(double eh, double ew, double t) {
return fabs(((ew * cos(t)) - (eh * (sin(t) * sin(atan((3.0 * ((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)) - (eh * (sin(t) * sin(atan((3.0d0 * ((eh / 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((3.0 * ((eh / t) / ew))))))));
}
def code(eh, ew, t): return math.fabs(((ew * math.cos(t)) - (eh * (math.sin(t) * math.sin(math.atan((3.0 * ((eh / t) / ew))))))))
function code(eh, ew, t) return abs(Float64(Float64(ew * cos(t)) - Float64(eh * Float64(sin(t) * sin(atan(Float64(3.0 * Float64(Float64(eh / t) / ew)))))))) end
function tmp = code(eh, ew, t) tmp = abs(((ew * cos(t)) - (eh * (sin(t) * sin(atan((3.0 * ((eh / t) / ew)))))))); end
code[eh_, ew_, t_] := N[Abs[N[(N[(ew * N[Cos[t], $MachinePrecision]), $MachinePrecision] - N[(eh * N[(N[Sin[t], $MachinePrecision] * N[Sin[N[ArcTan[N[(3.0 * N[(N[(eh / t), $MachinePrecision] / ew), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\left|ew \cdot \cos t - eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(3 \cdot \frac{\frac{eh}{t}}{ew}\right)\right)\right|
\end{array}
Initial program 99.8%
fabs-neg99.8%
sub0-neg99.8%
sub-neg99.8%
+-commutative99.8%
associate--r+99.8%
Simplified99.8%
cos-atan99.8%
hypot-1-def99.8%
div-inv99.8%
add-sqr-sqrt48.7%
sqrt-unprod95.5%
sqr-neg95.5%
sqrt-unprod51.1%
add-sqr-sqrt99.8%
clear-num99.8%
Applied egg-rr99.8%
*-commutative99.8%
associate-*l/99.8%
associate-*r/99.8%
Simplified99.8%
Taylor expanded in t around 0 89.4%
Taylor expanded in t around 0 88.7%
Taylor expanded in t around inf 88.6%
associate-/r*88.6%
Simplified88.6%
Final simplification88.6%
(FPCore (eh ew t) :precision binary64 (fabs (- (* ew (cos t)) (* eh (* (sin t) (sin (atan (* (/ eh ew) (/ 3.0 t)))))))))
double code(double eh, double ew, double t) {
return fabs(((ew * cos(t)) - (eh * (sin(t) * sin(atan(((eh / ew) * (3.0 / t))))))));
}
real(8) function code(eh, ew, t)
real(8), intent (in) :: eh
real(8), intent (in) :: ew
real(8), intent (in) :: t
code = abs(((ew * cos(t)) - (eh * (sin(t) * sin(atan(((eh / ew) * (3.0d0 / t))))))))
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 / ew) * (3.0 / t))))))));
}
def code(eh, ew, t): return math.fabs(((ew * math.cos(t)) - (eh * (math.sin(t) * math.sin(math.atan(((eh / ew) * (3.0 / t))))))))
function code(eh, ew, t) return abs(Float64(Float64(ew * cos(t)) - Float64(eh * Float64(sin(t) * sin(atan(Float64(Float64(eh / ew) * Float64(3.0 / t)))))))) end
function tmp = code(eh, ew, t) tmp = abs(((ew * cos(t)) - (eh * (sin(t) * sin(atan(((eh / ew) * (3.0 / t)))))))); 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[(eh / ew), $MachinePrecision] * N[(3.0 / t), $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(\frac{eh}{ew} \cdot \frac{3}{t}\right)\right)\right|
\end{array}
Initial program 99.8%
fabs-neg99.8%
sub0-neg99.8%
sub-neg99.8%
+-commutative99.8%
associate--r+99.8%
Simplified99.8%
cos-atan99.8%
hypot-1-def99.8%
div-inv99.8%
add-sqr-sqrt48.7%
sqrt-unprod95.5%
sqr-neg95.5%
sqrt-unprod51.1%
add-sqr-sqrt99.8%
clear-num99.8%
Applied egg-rr99.8%
*-commutative99.8%
associate-*l/99.8%
associate-*r/99.8%
Simplified99.8%
Taylor expanded in t around 0 89.4%
Taylor expanded in t around 0 88.7%
Taylor expanded in t around inf 88.6%
associate-*r/88.6%
times-frac88.6%
Simplified88.6%
Final simplification88.6%
(FPCore (eh ew t)
:precision binary64
(if (or (<= ew -5e+121) (not (<= ew 1.5e-50)))
(fabs (* ew (* (cos t) (/ 1.0 (hypot 1.0 (* (tan t) (/ eh ew)))))))
(fabs
(-
ew
(*
eh
(*
(sin t)
(sin
(atan (/ (- eh) (+ (* -0.3333333333333333 (* ew t)) (/ ew t)))))))))))
double code(double eh, double ew, double t) {
double tmp;
if ((ew <= -5e+121) || !(ew <= 1.5e-50)) {
tmp = fabs((ew * (cos(t) * (1.0 / hypot(1.0, (tan(t) * (eh / ew)))))));
} else {
tmp = fabs((ew - (eh * (sin(t) * sin(atan((-eh / ((-0.3333333333333333 * (ew * t)) + (ew / t)))))))));
}
return tmp;
}
public static double code(double eh, double ew, double t) {
double tmp;
if ((ew <= -5e+121) || !(ew <= 1.5e-50)) {
tmp = Math.abs((ew * (Math.cos(t) * (1.0 / Math.hypot(1.0, (Math.tan(t) * (eh / ew)))))));
} else {
tmp = Math.abs((ew - (eh * (Math.sin(t) * Math.sin(Math.atan((-eh / ((-0.3333333333333333 * (ew * t)) + (ew / t)))))))));
}
return tmp;
}
def code(eh, ew, t): tmp = 0 if (ew <= -5e+121) or not (ew <= 1.5e-50): tmp = math.fabs((ew * (math.cos(t) * (1.0 / math.hypot(1.0, (math.tan(t) * (eh / ew))))))) else: tmp = math.fabs((ew - (eh * (math.sin(t) * math.sin(math.atan((-eh / ((-0.3333333333333333 * (ew * t)) + (ew / t))))))))) return tmp
function code(eh, ew, t) tmp = 0.0 if ((ew <= -5e+121) || !(ew <= 1.5e-50)) tmp = abs(Float64(ew * Float64(cos(t) * Float64(1.0 / hypot(1.0, Float64(tan(t) * Float64(eh / ew))))))); else tmp = abs(Float64(ew - Float64(eh * Float64(sin(t) * sin(atan(Float64(Float64(-eh) / Float64(Float64(-0.3333333333333333 * Float64(ew * t)) + Float64(ew / t))))))))); end return tmp end
function tmp_2 = code(eh, ew, t) tmp = 0.0; if ((ew <= -5e+121) || ~((ew <= 1.5e-50))) tmp = abs((ew * (cos(t) * (1.0 / hypot(1.0, (tan(t) * (eh / ew))))))); else tmp = abs((ew - (eh * (sin(t) * sin(atan((-eh / ((-0.3333333333333333 * (ew * t)) + (ew / t))))))))); end tmp_2 = tmp; end
code[eh_, ew_, t_] := If[Or[LessEqual[ew, -5e+121], N[Not[LessEqual[ew, 1.5e-50]], $MachinePrecision]], N[Abs[N[(ew * N[(N[Cos[t], $MachinePrecision] * N[(1.0 / N[Sqrt[1.0 ^ 2 + N[(N[Tan[t], $MachinePrecision] * N[(eh / ew), $MachinePrecision]), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Abs[N[(ew - N[(eh * N[(N[Sin[t], $MachinePrecision] * N[Sin[N[ArcTan[N[((-eh) / N[(N[(-0.3333333333333333 * N[(ew * t), $MachinePrecision]), $MachinePrecision] + N[(ew / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;ew \leq -5 \cdot 10^{+121} \lor \neg \left(ew \leq 1.5 \cdot 10^{-50}\right):\\
\;\;\;\;\left|ew \cdot \left(\cos t \cdot \frac{1}{\mathsf{hypot}\left(1, \tan t \cdot \frac{eh}{ew}\right)}\right)\right|\\
\mathbf{else}:\\
\;\;\;\;\left|ew - eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\frac{-eh}{-0.3333333333333333 \cdot \left(ew \cdot t\right) + \frac{ew}{t}}\right)\right)\right|\\
\end{array}
\end{array}
if ew < -5.00000000000000007e121 or 1.49999999999999995e-50 < ew Initial program 99.8%
fabs-neg99.8%
sub0-neg99.8%
sub-neg99.8%
+-commutative99.8%
associate--r+99.8%
Simplified99.8%
cos-atan99.8%
hypot-1-def99.8%
div-inv99.8%
add-sqr-sqrt47.9%
sqrt-unprod90.4%
sqr-neg90.4%
sqrt-unprod51.9%
add-sqr-sqrt99.8%
clear-num99.8%
Applied egg-rr99.8%
*-commutative99.8%
associate-*l/99.8%
associate-*r/99.8%
Simplified99.8%
sin-mult87.2%
associate-*r/87.2%
Applied egg-rr86.6%
+-inverses86.8%
*-commutative86.8%
associate-/l*86.8%
div086.8%
Simplified86.6%
if -5.00000000000000007e121 < ew < 1.49999999999999995e-50Initial program 99.8%
fabs-neg99.8%
sub0-neg99.8%
sub-neg99.8%
+-commutative99.8%
associate--r+99.8%
Simplified99.8%
cos-atan99.8%
hypot-1-def99.8%
div-inv99.8%
add-sqr-sqrt49.2%
sqrt-unprod98.9%
sqr-neg98.9%
sqrt-unprod50.6%
add-sqr-sqrt99.8%
clear-num99.8%
Applied egg-rr99.8%
*-commutative99.8%
associate-*l/99.8%
associate-*r/99.8%
Simplified99.8%
Taylor expanded in t around 0 87.1%
Taylor expanded in t around 0 85.9%
Taylor expanded in t around 0 79.6%
Final simplification82.4%
(FPCore (eh ew t)
:precision binary64
(let* ((t_1 (atan (/ (- eh) (+ (* -0.3333333333333333 (* ew t)) (/ ew t))))))
(if (or (<= ew -5.4e+119) (not (<= ew 1.55e-50)))
(fabs (* ew (* (cos t) (cos t_1))))
(fabs (- ew (* eh (* (sin t) (sin t_1))))))))
double code(double eh, double ew, double t) {
double t_1 = atan((-eh / ((-0.3333333333333333 * (ew * t)) + (ew / t))));
double tmp;
if ((ew <= -5.4e+119) || !(ew <= 1.55e-50)) {
tmp = fabs((ew * (cos(t) * cos(t_1))));
} else {
tmp = fabs((ew - (eh * (sin(t) * sin(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 = atan((-eh / (((-0.3333333333333333d0) * (ew * t)) + (ew / t))))
if ((ew <= (-5.4d+119)) .or. (.not. (ew <= 1.55d-50))) then
tmp = abs((ew * (cos(t) * cos(t_1))))
else
tmp = abs((ew - (eh * (sin(t) * sin(t_1)))))
end if
code = tmp
end function
public static double code(double eh, double ew, double t) {
double t_1 = Math.atan((-eh / ((-0.3333333333333333 * (ew * t)) + (ew / t))));
double tmp;
if ((ew <= -5.4e+119) || !(ew <= 1.55e-50)) {
tmp = Math.abs((ew * (Math.cos(t) * Math.cos(t_1))));
} else {
tmp = Math.abs((ew - (eh * (Math.sin(t) * Math.sin(t_1)))));
}
return tmp;
}
def code(eh, ew, t): t_1 = math.atan((-eh / ((-0.3333333333333333 * (ew * t)) + (ew / t)))) tmp = 0 if (ew <= -5.4e+119) or not (ew <= 1.55e-50): tmp = math.fabs((ew * (math.cos(t) * math.cos(t_1)))) else: tmp = math.fabs((ew - (eh * (math.sin(t) * math.sin(t_1))))) return tmp
function code(eh, ew, t) t_1 = atan(Float64(Float64(-eh) / Float64(Float64(-0.3333333333333333 * Float64(ew * t)) + Float64(ew / t)))) tmp = 0.0 if ((ew <= -5.4e+119) || !(ew <= 1.55e-50)) tmp = abs(Float64(ew * Float64(cos(t) * cos(t_1)))); else tmp = abs(Float64(ew - Float64(eh * Float64(sin(t) * sin(t_1))))); end return tmp end
function tmp_2 = code(eh, ew, t) t_1 = atan((-eh / ((-0.3333333333333333 * (ew * t)) + (ew / t)))); tmp = 0.0; if ((ew <= -5.4e+119) || ~((ew <= 1.55e-50))) tmp = abs((ew * (cos(t) * cos(t_1)))); else tmp = abs((ew - (eh * (sin(t) * sin(t_1))))); end tmp_2 = tmp; end
code[eh_, ew_, t_] := Block[{t$95$1 = N[ArcTan[N[((-eh) / N[(N[(-0.3333333333333333 * N[(ew * t), $MachinePrecision]), $MachinePrecision] + N[(ew / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[Or[LessEqual[ew, -5.4e+119], N[Not[LessEqual[ew, 1.55e-50]], $MachinePrecision]], N[Abs[N[(ew * N[(N[Cos[t], $MachinePrecision] * N[Cos[t$95$1], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Abs[N[(ew - 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(\frac{-eh}{-0.3333333333333333 \cdot \left(ew \cdot t\right) + \frac{ew}{t}}\right)\\
\mathbf{if}\;ew \leq -5.4 \cdot 10^{+119} \lor \neg \left(ew \leq 1.55 \cdot 10^{-50}\right):\\
\;\;\;\;\left|ew \cdot \left(\cos t \cdot \cos t_1\right)\right|\\
\mathbf{else}:\\
\;\;\;\;\left|ew - eh \cdot \left(\sin t \cdot \sin t_1\right)\right|\\
\end{array}
\end{array}
if ew < -5.3999999999999997e119 or 1.5500000000000001e-50 < ew Initial program 99.8%
fabs-neg99.8%
sub0-neg99.8%
sub-neg99.8%
+-commutative99.8%
associate--r+99.8%
Simplified99.8%
sin-mult87.2%
associate-*r/87.2%
Applied egg-rr86.8%
+-inverses86.8%
*-commutative86.8%
associate-/l*86.8%
div086.8%
Simplified86.8%
Taylor expanded in t around 0 86.8%
if -5.3999999999999997e119 < ew < 1.5500000000000001e-50Initial program 99.8%
fabs-neg99.8%
sub0-neg99.8%
sub-neg99.8%
+-commutative99.8%
associate--r+99.8%
Simplified99.8%
cos-atan99.8%
hypot-1-def99.8%
div-inv99.8%
add-sqr-sqrt49.2%
sqrt-unprod98.9%
sqr-neg98.9%
sqrt-unprod50.6%
add-sqr-sqrt99.8%
clear-num99.8%
Applied egg-rr99.8%
*-commutative99.8%
associate-*l/99.8%
associate-*r/99.8%
Simplified99.8%
Taylor expanded in t around 0 87.1%
Taylor expanded in t around 0 85.9%
Taylor expanded in t around 0 79.6%
Final simplification82.5%
(FPCore (eh ew t) :precision binary64 (fabs (* ew (* (cos t) (/ 1.0 (hypot 1.0 (* (tan t) (/ eh ew))))))))
double code(double eh, double ew, double t) {
return fabs((ew * (cos(t) * (1.0 / hypot(1.0, (tan(t) * (eh / ew)))))));
}
public static double code(double eh, double ew, double t) {
return Math.abs((ew * (Math.cos(t) * (1.0 / Math.hypot(1.0, (Math.tan(t) * (eh / ew)))))));
}
def code(eh, ew, t): return math.fabs((ew * (math.cos(t) * (1.0 / math.hypot(1.0, (math.tan(t) * (eh / ew)))))))
function code(eh, ew, t) return abs(Float64(ew * Float64(cos(t) * Float64(1.0 / hypot(1.0, Float64(tan(t) * Float64(eh / ew))))))) end
function tmp = code(eh, ew, t) tmp = abs((ew * (cos(t) * (1.0 / hypot(1.0, (tan(t) * (eh / ew))))))); end
code[eh_, ew_, t_] := N[Abs[N[(ew * N[(N[Cos[t], $MachinePrecision] * N[(1.0 / N[Sqrt[1.0 ^ 2 + N[(N[Tan[t], $MachinePrecision] * N[(eh / ew), $MachinePrecision]), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\left|ew \cdot \left(\cos t \cdot \frac{1}{\mathsf{hypot}\left(1, \tan t \cdot \frac{eh}{ew}\right)}\right)\right|
\end{array}
Initial program 99.8%
fabs-neg99.8%
sub0-neg99.8%
sub-neg99.8%
+-commutative99.8%
associate--r+99.8%
Simplified99.8%
cos-atan99.8%
hypot-1-def99.8%
div-inv99.8%
add-sqr-sqrt48.7%
sqrt-unprod95.5%
sqr-neg95.5%
sqrt-unprod51.1%
add-sqr-sqrt99.8%
clear-num99.8%
Applied egg-rr99.8%
*-commutative99.8%
associate-*l/99.8%
associate-*r/99.8%
Simplified99.8%
sin-mult62.6%
associate-*r/62.6%
Applied egg-rr60.1%
+-inverses60.4%
*-commutative60.4%
associate-/l*60.4%
div060.4%
Simplified60.1%
Final simplification60.1%
(FPCore (eh ew t) :precision binary64 (fabs (* ew (* (cos t) (cos (atan (/ (- t) (/ ew eh))))))))
double code(double eh, double ew, double t) {
return fabs((ew * (cos(t) * cos(atan((-t / (ew / 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(t) * cos(atan((-t / (ew / eh)))))))
end function
public static double code(double eh, double ew, double t) {
return Math.abs((ew * (Math.cos(t) * Math.cos(Math.atan((-t / (ew / eh)))))));
}
def code(eh, ew, t): return math.fabs((ew * (math.cos(t) * math.cos(math.atan((-t / (ew / eh)))))))
function code(eh, ew, t) return abs(Float64(ew * Float64(cos(t) * cos(atan(Float64(Float64(-t) / Float64(ew / eh))))))) end
function tmp = code(eh, ew, t) tmp = abs((ew * (cos(t) * cos(atan((-t / (ew / eh))))))); end
code[eh_, ew_, t_] := N[Abs[N[(ew * N[(N[Cos[t], $MachinePrecision] * N[Cos[N[ArcTan[N[((-t) / N[(ew / eh), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\left|ew \cdot \left(\cos t \cdot \cos \tan^{-1} \left(\frac{-t}{\frac{ew}{eh}}\right)\right)\right|
\end{array}
Initial program 99.8%
fabs-neg99.8%
sub0-neg99.8%
sub-neg99.8%
+-commutative99.8%
associate--r+99.8%
Simplified99.8%
sin-mult62.6%
associate-*r/62.6%
Applied egg-rr60.4%
+-inverses60.4%
*-commutative60.4%
associate-/l*60.4%
div060.4%
Simplified60.4%
Taylor expanded in t around 0 50.1%
mul-1-neg50.1%
associate-/l*50.1%
distribute-neg-frac50.1%
Simplified50.1%
Final simplification50.1%
(FPCore (eh ew t) :precision binary64 (fabs (* ew (cos (atan (/ (* (tan t) eh) ew))))))
double code(double eh, double ew, double t) {
return fabs((ew * cos(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(atan(((tan(t) * eh) / ew)))))
end function
public static double code(double eh, double ew, double t) {
return Math.abs((ew * Math.cos(Math.atan(((Math.tan(t) * eh) / ew)))));
}
def code(eh, ew, t): return math.fabs((ew * math.cos(math.atan(((math.tan(t) * eh) / ew)))))
function code(eh, ew, t) return abs(Float64(ew * cos(atan(Float64(Float64(tan(t) * eh) / ew))))) end
function tmp = code(eh, ew, t) tmp = abs((ew * cos(atan(((tan(t) * eh) / ew))))); end
code[eh_, ew_, t_] := N[Abs[N[(ew * N[Cos[N[ArcTan[N[(N[(N[Tan[t], $MachinePrecision] * eh), $MachinePrecision] / ew), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\left|ew \cdot \cos \tan^{-1} \left(\frac{\tan t \cdot eh}{ew}\right)\right|
\end{array}
Initial program 99.8%
fabs-neg99.8%
sub0-neg99.8%
sub-neg99.8%
+-commutative99.8%
associate--r+99.8%
Simplified99.8%
sin-mult62.6%
associate-*r/62.6%
Applied egg-rr60.4%
+-inverses60.4%
*-commutative60.4%
associate-/l*60.4%
div060.4%
Simplified60.4%
add-sqr-sqrt28.7%
pow228.7%
Applied egg-rr28.7%
Taylor expanded in t around 0 41.4%
Final simplification41.4%
(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%
fabs-neg99.8%
sub0-neg99.8%
sub-neg99.8%
+-commutative99.8%
associate--r+99.8%
Simplified99.8%
sin-mult62.6%
associate-*r/62.6%
Applied egg-rr60.4%
+-inverses60.4%
*-commutative60.4%
associate-/l*60.4%
div060.4%
Simplified60.4%
Taylor expanded in t around 0 41.4%
*-commutative41.4%
mul-1-neg41.4%
associate-*r/41.4%
distribute-rgt-neg-in41.4%
distribute-neg-frac41.4%
Simplified41.4%
cos-atan41.0%
Applied egg-rr41.0%
hypot-1-def41.1%
*-commutative41.1%
associate-/r/41.1%
hypot-1-def41.1%
distribute-frac-neg41.1%
neg-mul-141.1%
associate-/l*41.1%
*-commutative41.1%
distribute-frac-neg41.1%
associate-/r/41.0%
*-commutative41.0%
associate-*r/41.1%
mul-1-neg41.1%
sqr-neg41.1%
Simplified41.1%
Final simplification41.1%
(FPCore (eh ew t) :precision binary64 (fabs (* ew (cos (atan (/ (* t (- eh)) ew))))))
double code(double eh, double ew, double t) {
return fabs((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 = abs((ew * cos(atan(((t * -eh) / ew)))))
end function
public static double code(double eh, double ew, double t) {
return Math.abs((ew * Math.cos(Math.atan(((t * -eh) / ew)))));
}
def code(eh, ew, t): return math.fabs((ew * math.cos(math.atan(((t * -eh) / ew)))))
function code(eh, ew, t) return abs(Float64(ew * cos(atan(Float64(Float64(t * Float64(-eh)) / ew))))) end
function tmp = code(eh, ew, t) tmp = abs((ew * cos(atan(((t * -eh) / ew))))); end
code[eh_, ew_, t_] := N[Abs[N[(ew * N[Cos[N[ArcTan[N[(N[(t * (-eh)), $MachinePrecision] / ew), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\left|ew \cdot \cos \tan^{-1} \left(\frac{t \cdot \left(-eh\right)}{ew}\right)\right|
\end{array}
Initial program 99.8%
fabs-neg99.8%
sub0-neg99.8%
sub-neg99.8%
+-commutative99.8%
associate--r+99.8%
Simplified99.8%
sin-mult62.6%
associate-*r/62.6%
Applied egg-rr60.4%
+-inverses60.4%
*-commutative60.4%
associate-/l*60.4%
div060.4%
Simplified60.4%
Taylor expanded in t around 0 41.4%
*-commutative41.4%
mul-1-neg41.4%
associate-*r/41.4%
distribute-rgt-neg-in41.4%
distribute-neg-frac41.4%
Simplified41.4%
Taylor expanded in t around 0 39.8%
associate-*r/39.8%
*-commutative39.8%
associate-*r*39.8%
neg-mul-139.8%
Simplified39.8%
Final simplification39.8%
(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%
fabs-neg99.8%
sub0-neg99.8%
sub-neg99.8%
+-commutative99.8%
associate--r+99.8%
Simplified99.8%
sin-mult62.6%
associate-*r/62.6%
Applied egg-rr60.4%
+-inverses60.4%
*-commutative60.4%
associate-/l*60.4%
div060.4%
Simplified60.4%
Taylor expanded in t around 0 41.4%
*-commutative41.4%
mul-1-neg41.4%
associate-*r/41.4%
distribute-rgt-neg-in41.4%
distribute-neg-frac41.4%
Simplified41.4%
Taylor expanded in t around 0 39.8%
associate-*r/39.8%
*-commutative39.8%
associate-*r*39.8%
neg-mul-139.8%
Simplified39.8%
cos-atan38.9%
associate-/l*38.8%
associate-/l*38.9%
Applied egg-rr38.9%
distribute-frac-neg38.9%
distribute-frac-neg38.9%
sqr-neg38.9%
associate-/l*38.8%
*-commutative38.8%
associate-/l*38.9%
associate-/l*38.8%
*-commutative38.8%
associate-/l*38.9%
hypot-1-def39.0%
associate-/l*38.9%
*-rgt-identity38.9%
associate-*r/38.9%
associate-*l*39.0%
associate-*r/39.0%
*-rgt-identity39.0%
Simplified39.0%
Final simplification39.0%
herbie shell --seed 2023178
(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)))))))