
(FPCore (eh ew t) :precision binary64 (let* ((t_1 (atan (/ (* (- eh) (tan t)) ew)))) (fabs (- (* (* ew (cos t)) (cos t_1)) (* (* eh (sin t)) (sin t_1))))))
double code(double eh, double ew, double t) {
double t_1 = atan(((-eh * tan(t)) / ew));
return fabs((((ew * cos(t)) * cos(t_1)) - ((eh * sin(t)) * sin(t_1))));
}
real(8) function code(eh, ew, t)
real(8), intent (in) :: eh
real(8), intent (in) :: ew
real(8), intent (in) :: t
real(8) :: t_1
t_1 = atan(((-eh * tan(t)) / ew))
code = abs((((ew * cos(t)) * cos(t_1)) - ((eh * sin(t)) * sin(t_1))))
end function
public static double code(double eh, double ew, double t) {
double t_1 = Math.atan(((-eh * Math.tan(t)) / ew));
return Math.abs((((ew * Math.cos(t)) * Math.cos(t_1)) - ((eh * Math.sin(t)) * Math.sin(t_1))));
}
def code(eh, ew, t): t_1 = math.atan(((-eh * math.tan(t)) / ew)) return math.fabs((((ew * math.cos(t)) * math.cos(t_1)) - ((eh * math.sin(t)) * math.sin(t_1))))
function code(eh, ew, t) t_1 = atan(Float64(Float64(Float64(-eh) * tan(t)) / ew)) return abs(Float64(Float64(Float64(ew * cos(t)) * cos(t_1)) - Float64(Float64(eh * sin(t)) * sin(t_1)))) end
function tmp = code(eh, ew, t) t_1 = atan(((-eh * tan(t)) / ew)); tmp = abs((((ew * cos(t)) * cos(t_1)) - ((eh * sin(t)) * sin(t_1)))); end
code[eh_, ew_, t_] := Block[{t$95$1 = N[ArcTan[N[(N[((-eh) * N[Tan[t], $MachinePrecision]), $MachinePrecision] / ew), $MachinePrecision]], $MachinePrecision]}, N[Abs[N[(N[(N[(ew * N[Cos[t], $MachinePrecision]), $MachinePrecision] * N[Cos[t$95$1], $MachinePrecision]), $MachinePrecision] - N[(N[(eh * N[Sin[t], $MachinePrecision]), $MachinePrecision] * N[Sin[t$95$1], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\\
\left|\left(ew \cdot \cos t\right) \cdot \cos t\_1 - \left(eh \cdot \sin t\right) \cdot \sin t\_1\right|
\end{array}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 17 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (eh ew t) :precision binary64 (let* ((t_1 (atan (/ (* (- eh) (tan t)) ew)))) (fabs (- (* (* ew (cos t)) (cos t_1)) (* (* eh (sin t)) (sin t_1))))))
double code(double eh, double ew, double t) {
double t_1 = atan(((-eh * tan(t)) / ew));
return fabs((((ew * cos(t)) * cos(t_1)) - ((eh * sin(t)) * sin(t_1))));
}
real(8) function code(eh, ew, t)
real(8), intent (in) :: eh
real(8), intent (in) :: ew
real(8), intent (in) :: t
real(8) :: t_1
t_1 = atan(((-eh * tan(t)) / ew))
code = abs((((ew * cos(t)) * cos(t_1)) - ((eh * sin(t)) * sin(t_1))))
end function
public static double code(double eh, double ew, double t) {
double t_1 = Math.atan(((-eh * Math.tan(t)) / ew));
return Math.abs((((ew * Math.cos(t)) * Math.cos(t_1)) - ((eh * Math.sin(t)) * Math.sin(t_1))));
}
def code(eh, ew, t): t_1 = math.atan(((-eh * math.tan(t)) / ew)) return math.fabs((((ew * math.cos(t)) * math.cos(t_1)) - ((eh * math.sin(t)) * math.sin(t_1))))
function code(eh, ew, t) t_1 = atan(Float64(Float64(Float64(-eh) * tan(t)) / ew)) return abs(Float64(Float64(Float64(ew * cos(t)) * cos(t_1)) - Float64(Float64(eh * sin(t)) * sin(t_1)))) end
function tmp = code(eh, ew, t) t_1 = atan(((-eh * tan(t)) / ew)); tmp = abs((((ew * cos(t)) * cos(t_1)) - ((eh * sin(t)) * sin(t_1)))); end
code[eh_, ew_, t_] := Block[{t$95$1 = N[ArcTan[N[(N[((-eh) * N[Tan[t], $MachinePrecision]), $MachinePrecision] / ew), $MachinePrecision]], $MachinePrecision]}, N[Abs[N[(N[(N[(ew * N[Cos[t], $MachinePrecision]), $MachinePrecision] * N[Cos[t$95$1], $MachinePrecision]), $MachinePrecision] - N[(N[(eh * N[Sin[t], $MachinePrecision]), $MachinePrecision] * N[Sin[t$95$1], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\\
\left|\left(ew \cdot \cos t\right) \cdot \cos t\_1 - \left(eh \cdot \sin t\right) \cdot \sin t\_1\right|
\end{array}
\end{array}
(FPCore (eh ew t) :precision binary64 (fabs (- (* (/ 1.0 (hypot 1.0 (* (tan t) (/ eh ew)))) (* ew (cos t))) (* (* eh (sin t)) (sin (atan (/ (* (tan t) (- eh)) ew)))))))
double code(double eh, double ew, double t) {
return fabs((((1.0 / hypot(1.0, (tan(t) * (eh / ew)))) * (ew * cos(t))) - ((eh * sin(t)) * sin(atan(((tan(t) * -eh) / ew))))));
}
public static double code(double eh, double ew, double t) {
return Math.abs((((1.0 / Math.hypot(1.0, (Math.tan(t) * (eh / ew)))) * (ew * Math.cos(t))) - ((eh * Math.sin(t)) * Math.sin(Math.atan(((Math.tan(t) * -eh) / ew))))));
}
def code(eh, ew, t): return math.fabs((((1.0 / math.hypot(1.0, (math.tan(t) * (eh / ew)))) * (ew * math.cos(t))) - ((eh * math.sin(t)) * math.sin(math.atan(((math.tan(t) * -eh) / ew))))))
function code(eh, ew, t) return abs(Float64(Float64(Float64(1.0 / hypot(1.0, Float64(tan(t) * Float64(eh / ew)))) * Float64(ew * cos(t))) - Float64(Float64(eh * sin(t)) * sin(atan(Float64(Float64(tan(t) * Float64(-eh)) / ew)))))) end
function tmp = code(eh, ew, t) tmp = abs((((1.0 / hypot(1.0, (tan(t) * (eh / ew)))) * (ew * cos(t))) - ((eh * sin(t)) * sin(atan(((tan(t) * -eh) / ew)))))); end
code[eh_, ew_, t_] := N[Abs[N[(N[(N[(1.0 / N[Sqrt[1.0 ^ 2 + N[(N[Tan[t], $MachinePrecision] * N[(eh / ew), $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[(N[Tan[t], $MachinePrecision] * (-eh)), $MachinePrecision] / ew), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\left|\frac{1}{\mathsf{hypot}\left(1, \tan t \cdot \frac{eh}{ew}\right)} \cdot \left(ew \cdot \cos t\right) - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\tan t \cdot \left(-eh\right)}{ew}\right)\right|
\end{array}
Initial program 99.8%
cos-atan99.8%
hypot-1-def99.8%
associate-/l*99.8%
add-sqr-sqrt55.0%
sqrt-unprod95.8%
sqr-neg95.8%
sqrt-unprod44.8%
add-sqr-sqrt99.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 (fabs (- (* (/ 1.0 (hypot 1.0 (* (tan t) (/ eh ew)))) (* 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, (tan(t) * (eh / ew)))) * (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, (Math.tan(t) * (eh / ew)))) * (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, (math.tan(t) * (eh / ew)))) * (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(tan(t) * Float64(eh / ew)))) * 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, (tan(t) * (eh / ew)))) * (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[Tan[t], $MachinePrecision] * N[(eh / ew), $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, \tan t \cdot \frac{eh}{ew}\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%
Taylor expanded in t around 0 99.2%
associate-*r*99.2%
mul-1-neg99.2%
Simplified99.2%
cos-atan99.8%
hypot-1-def99.8%
associate-/l*99.8%
add-sqr-sqrt55.0%
sqrt-unprod95.8%
sqr-neg95.8%
sqrt-unprod44.8%
add-sqr-sqrt99.8%
Applied egg-rr99.2%
*-commutative99.8%
associate-*l/99.8%
associate-*r/99.8%
Simplified99.2%
Final simplification99.2%
(FPCore (eh ew t) :precision binary64 (fabs (- (* ew (cos t)) (* (* eh (sin t)) (sin (atan (/ (* (tan t) (- eh)) ew)))))))
double code(double eh, double ew, double t) {
return fabs(((ew * cos(t)) - ((eh * sin(t)) * sin(atan(((tan(t) * -eh) / ew))))));
}
real(8) function code(eh, ew, t)
real(8), intent (in) :: eh
real(8), intent (in) :: ew
real(8), intent (in) :: t
code = abs(((ew * cos(t)) - ((eh * sin(t)) * sin(atan(((tan(t) * -eh) / ew))))))
end function
public static double code(double eh, double ew, double t) {
return Math.abs(((ew * Math.cos(t)) - ((eh * Math.sin(t)) * Math.sin(Math.atan(((Math.tan(t) * -eh) / ew))))));
}
def code(eh, ew, t): return math.fabs(((ew * math.cos(t)) - ((eh * math.sin(t)) * math.sin(math.atan(((math.tan(t) * -eh) / ew))))))
function code(eh, ew, t) return abs(Float64(Float64(ew * cos(t)) - Float64(Float64(eh * sin(t)) * sin(atan(Float64(Float64(tan(t) * Float64(-eh)) / ew)))))) end
function tmp = code(eh, ew, t) tmp = abs(((ew * cos(t)) - ((eh * sin(t)) * sin(atan(((tan(t) * -eh) / ew)))))); end
code[eh_, ew_, t_] := N[Abs[N[(N[(ew * N[Cos[t], $MachinePrecision]), $MachinePrecision] - N[(N[(eh * N[Sin[t], $MachinePrecision]), $MachinePrecision] * N[Sin[N[ArcTan[N[(N[(N[Tan[t], $MachinePrecision] * (-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{\tan t \cdot \left(-eh\right)}{ew}\right)\right|
\end{array}
Initial program 99.8%
cos-atan99.8%
hypot-1-def99.8%
associate-/l*99.8%
add-sqr-sqrt55.0%
sqrt-unprod95.8%
sqr-neg95.8%
sqrt-unprod44.8%
add-sqr-sqrt99.8%
Applied egg-rr99.8%
*-commutative99.8%
associate-*l/99.8%
associate-*r/99.8%
Simplified99.8%
Taylor expanded in t around 0 98.6%
Final simplification98.6%
(FPCore (eh ew t) :precision binary64 (fabs (- (* ew (cos t)) (* (* eh (sin t)) (sin (atan (/ (* (tan t) eh) ew)))))))
double code(double eh, double ew, double t) {
return fabs(((ew * cos(t)) - ((eh * sin(t)) * sin(atan(((tan(t) * eh) / ew))))));
}
real(8) function code(eh, ew, t)
real(8), intent (in) :: eh
real(8), intent (in) :: ew
real(8), intent (in) :: t
code = abs(((ew * cos(t)) - ((eh * sin(t)) * sin(atan(((tan(t) * eh) / ew))))))
end function
public static double code(double eh, double ew, double t) {
return Math.abs(((ew * Math.cos(t)) - ((eh * Math.sin(t)) * Math.sin(Math.atan(((Math.tan(t) * eh) / ew))))));
}
def code(eh, ew, t): return math.fabs(((ew * math.cos(t)) - ((eh * math.sin(t)) * math.sin(math.atan(((math.tan(t) * eh) / ew))))))
function code(eh, ew, t) return abs(Float64(Float64(ew * cos(t)) - Float64(Float64(eh * sin(t)) * sin(atan(Float64(Float64(tan(t) * eh) / ew)))))) end
function tmp = code(eh, ew, t) tmp = abs(((ew * cos(t)) - ((eh * sin(t)) * sin(atan(((tan(t) * eh) / ew)))))); end
code[eh_, ew_, t_] := N[Abs[N[(N[(ew * N[Cos[t], $MachinePrecision]), $MachinePrecision] - N[(N[(eh * N[Sin[t], $MachinePrecision]), $MachinePrecision] * N[Sin[N[ArcTan[N[(N[(N[Tan[t], $MachinePrecision] * 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{\tan t \cdot eh}{ew}\right)\right|
\end{array}
Initial program 99.8%
cos-atan99.8%
hypot-1-def99.8%
associate-/l*99.8%
add-sqr-sqrt55.0%
sqrt-unprod95.8%
sqr-neg95.8%
sqrt-unprod44.8%
add-sqr-sqrt99.8%
Applied egg-rr99.8%
*-commutative99.8%
associate-*l/99.8%
associate-*r/99.8%
Simplified99.8%
Taylor expanded in t around 0 98.6%
add-log-exp91.4%
*-un-lft-identity91.4%
log-prod91.4%
metadata-eval91.4%
add-log-exp98.6%
add-sqr-sqrt54.5%
sqrt-unprod97.8%
sqr-neg97.8%
sqrt-unprod44.0%
add-sqr-sqrt98.5%
Applied egg-rr98.5%
+-lft-identity98.5%
Simplified98.5%
Final simplification98.5%
(FPCore (eh ew t)
:precision binary64
(let* ((t_1 (/ (* t eh) ew)) (t_2 (* eh (sin t))))
(if (<= eh -1.75e+122)
(fabs (- ew (* eh (* (sin t) (sin (atan (* eh (/ (tan t) ew))))))))
(if (<= eh 5.2e-69)
(fabs (- (* ew (cos t)) (* t_1 (/ t_2 (hypot 1.0 t_1)))))
(fabs (- ew (* t_2 (sin (atan (/ (* t (- eh)) ew))))))))))
double code(double eh, double ew, double t) {
double t_1 = (t * eh) / ew;
double t_2 = eh * sin(t);
double tmp;
if (eh <= -1.75e+122) {
tmp = fabs((ew - (eh * (sin(t) * sin(atan((eh * (tan(t) / ew))))))));
} else if (eh <= 5.2e-69) {
tmp = fabs(((ew * cos(t)) - (t_1 * (t_2 / hypot(1.0, t_1)))));
} else {
tmp = fabs((ew - (t_2 * sin(atan(((t * -eh) / ew))))));
}
return tmp;
}
public static double code(double eh, double ew, double t) {
double t_1 = (t * eh) / ew;
double t_2 = eh * Math.sin(t);
double tmp;
if (eh <= -1.75e+122) {
tmp = Math.abs((ew - (eh * (Math.sin(t) * Math.sin(Math.atan((eh * (Math.tan(t) / ew))))))));
} else if (eh <= 5.2e-69) {
tmp = Math.abs(((ew * Math.cos(t)) - (t_1 * (t_2 / Math.hypot(1.0, t_1)))));
} else {
tmp = Math.abs((ew - (t_2 * Math.sin(Math.atan(((t * -eh) / ew))))));
}
return tmp;
}
def code(eh, ew, t): t_1 = (t * eh) / ew t_2 = eh * math.sin(t) tmp = 0 if eh <= -1.75e+122: tmp = math.fabs((ew - (eh * (math.sin(t) * math.sin(math.atan((eh * (math.tan(t) / ew)))))))) elif eh <= 5.2e-69: tmp = math.fabs(((ew * math.cos(t)) - (t_1 * (t_2 / math.hypot(1.0, t_1))))) else: tmp = math.fabs((ew - (t_2 * math.sin(math.atan(((t * -eh) / ew)))))) return tmp
function code(eh, ew, t) t_1 = Float64(Float64(t * eh) / ew) t_2 = Float64(eh * sin(t)) tmp = 0.0 if (eh <= -1.75e+122) tmp = abs(Float64(ew - Float64(eh * Float64(sin(t) * sin(atan(Float64(eh * Float64(tan(t) / ew)))))))); elseif (eh <= 5.2e-69) tmp = abs(Float64(Float64(ew * cos(t)) - Float64(t_1 * Float64(t_2 / hypot(1.0, t_1))))); else tmp = abs(Float64(ew - Float64(t_2 * sin(atan(Float64(Float64(t * Float64(-eh)) / ew)))))); end return tmp end
function tmp_2 = code(eh, ew, t) t_1 = (t * eh) / ew; t_2 = eh * sin(t); tmp = 0.0; if (eh <= -1.75e+122) tmp = abs((ew - (eh * (sin(t) * sin(atan((eh * (tan(t) / ew)))))))); elseif (eh <= 5.2e-69) tmp = abs(((ew * cos(t)) - (t_1 * (t_2 / hypot(1.0, t_1))))); else tmp = abs((ew - (t_2 * sin(atan(((t * -eh) / ew)))))); end tmp_2 = tmp; end
code[eh_, ew_, t_] := Block[{t$95$1 = N[(N[(t * eh), $MachinePrecision] / ew), $MachinePrecision]}, Block[{t$95$2 = N[(eh * N[Sin[t], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[eh, -1.75e+122], N[Abs[N[(ew - N[(eh * N[(N[Sin[t], $MachinePrecision] * N[Sin[N[ArcTan[N[(eh * N[(N[Tan[t], $MachinePrecision] / ew), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[eh, 5.2e-69], N[Abs[N[(N[(ew * N[Cos[t], $MachinePrecision]), $MachinePrecision] - N[(t$95$1 * N[(t$95$2 / N[Sqrt[1.0 ^ 2 + t$95$1 ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Abs[N[(ew - N[(t$95$2 * N[Sin[N[ArcTan[N[(N[(t * (-eh)), $MachinePrecision] / ew), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t \cdot eh}{ew}\\
t_2 := eh \cdot \sin t\\
\mathbf{if}\;eh \leq -1.75 \cdot 10^{+122}:\\
\;\;\;\;\left|ew - eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(eh \cdot \frac{\tan t}{ew}\right)\right)\right|\\
\mathbf{elif}\;eh \leq 5.2 \cdot 10^{-69}:\\
\;\;\;\;\left|ew \cdot \cos t - t\_1 \cdot \frac{t\_2}{\mathsf{hypot}\left(1, t\_1\right)}\right|\\
\mathbf{else}:\\
\;\;\;\;\left|ew - t\_2 \cdot \sin \tan^{-1} \left(\frac{t \cdot \left(-eh\right)}{ew}\right)\right|\\
\end{array}
\end{array}
if eh < -1.75000000000000007e122Initial program 99.6%
cos-atan99.6%
hypot-1-def99.6%
associate-/l*99.6%
add-sqr-sqrt99.6%
sqrt-unprod85.2%
sqr-neg85.2%
sqrt-unprod0.0%
add-sqr-sqrt99.6%
Applied egg-rr99.6%
*-commutative99.6%
associate-*l/99.6%
associate-*r/99.6%
Simplified99.6%
Taylor expanded in t around 0 97.7%
Taylor expanded in t around 0 93.0%
pow193.0%
associate-*l*93.0%
associate-/l*93.0%
add-sqr-sqrt93.0%
sqrt-unprod81.5%
sqr-neg81.5%
sqrt-unprod0.0%
add-sqr-sqrt93.0%
Applied egg-rr93.0%
unpow193.0%
Simplified93.0%
if -1.75000000000000007e122 < eh < 5.2000000000000004e-69Initial program 99.8%
cos-atan99.8%
hypot-1-def99.8%
associate-/l*99.8%
add-sqr-sqrt70.6%
sqrt-unprod99.6%
sqr-neg99.6%
sqrt-unprod29.3%
add-sqr-sqrt99.8%
Applied egg-rr99.8%
*-commutative99.8%
associate-*l/99.8%
associate-*r/99.8%
Simplified99.8%
Taylor expanded in t around 0 99.0%
add-log-exp92.8%
*-un-lft-identity92.8%
log-prod92.8%
metadata-eval92.8%
add-log-exp99.0%
add-sqr-sqrt70.3%
sqrt-unprod97.8%
sqr-neg97.8%
sqrt-unprod28.7%
add-sqr-sqrt99.0%
Applied egg-rr99.0%
+-lft-identity99.0%
Simplified99.0%
Taylor expanded in t around 0 98.6%
sin-atan88.2%
associate-*r/88.1%
associate-/l*83.6%
hypot-1-def83.7%
associate-/l*83.6%
Applied egg-rr83.6%
*-commutative83.6%
associate-/l*84.9%
associate-*r/89.5%
associate-*r/89.7%
Simplified89.7%
if 5.2000000000000004e-69 < eh Initial program 99.9%
cos-atan99.9%
hypot-1-def99.9%
associate-/l*99.9%
add-sqr-sqrt0.0%
sqrt-unprod93.2%
sqr-neg93.2%
sqrt-unprod99.9%
add-sqr-sqrt99.9%
Applied egg-rr99.9%
*-commutative99.9%
associate-*l/99.9%
associate-*r/99.9%
Simplified99.9%
Taylor expanded in t around 0 98.0%
Taylor expanded in t around 0 89.4%
Taylor expanded in t around 0 89.4%
associate-*r*99.9%
mul-1-neg99.9%
Simplified89.4%
Final simplification90.0%
(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%
Taylor expanded in t around 0 99.2%
associate-*r*99.2%
mul-1-neg99.2%
Simplified99.2%
cos-atan99.8%
hypot-1-def99.8%
associate-/l*99.8%
add-sqr-sqrt55.0%
sqrt-unprod95.8%
sqr-neg95.8%
sqrt-unprod44.8%
add-sqr-sqrt99.8%
Applied egg-rr99.2%
*-commutative99.8%
associate-*l/99.8%
associate-*r/99.8%
Simplified99.2%
Taylor expanded in t around 0 98.3%
Final simplification98.3%
(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 * 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 eh}{ew}\right)\right|
\end{array}
Initial program 99.8%
cos-atan99.8%
hypot-1-def99.8%
associate-/l*99.8%
add-sqr-sqrt55.0%
sqrt-unprod95.8%
sqr-neg95.8%
sqrt-unprod44.8%
add-sqr-sqrt99.8%
Applied egg-rr99.8%
*-commutative99.8%
associate-*l/99.8%
associate-*r/99.8%
Simplified99.8%
Taylor expanded in t around 0 98.6%
add-log-exp91.4%
*-un-lft-identity91.4%
log-prod91.4%
metadata-eval91.4%
add-log-exp98.6%
add-sqr-sqrt54.5%
sqrt-unprod97.8%
sqr-neg97.8%
sqrt-unprod44.0%
add-sqr-sqrt98.5%
Applied egg-rr98.5%
+-lft-identity98.5%
Simplified98.5%
Taylor expanded in t around 0 98.3%
Final simplification98.3%
(FPCore (eh ew t)
:precision binary64
(let* ((t_1 (/ (* t eh) ew)) (t_2 (* eh (sin t))))
(if (or (<= eh -1.75e+122) (not (<= eh 5.2e-69)))
(fabs (- ew (* t_2 (sin (atan (/ (* t (- eh)) ew))))))
(fabs (- (* ew (cos t)) (* t_1 (/ t_2 (hypot 1.0 t_1))))))))
double code(double eh, double ew, double t) {
double t_1 = (t * eh) / ew;
double t_2 = eh * sin(t);
double tmp;
if ((eh <= -1.75e+122) || !(eh <= 5.2e-69)) {
tmp = fabs((ew - (t_2 * sin(atan(((t * -eh) / ew))))));
} else {
tmp = fabs(((ew * cos(t)) - (t_1 * (t_2 / hypot(1.0, t_1)))));
}
return tmp;
}
public static double code(double eh, double ew, double t) {
double t_1 = (t * eh) / ew;
double t_2 = eh * Math.sin(t);
double tmp;
if ((eh <= -1.75e+122) || !(eh <= 5.2e-69)) {
tmp = Math.abs((ew - (t_2 * Math.sin(Math.atan(((t * -eh) / ew))))));
} else {
tmp = Math.abs(((ew * Math.cos(t)) - (t_1 * (t_2 / Math.hypot(1.0, t_1)))));
}
return tmp;
}
def code(eh, ew, t): t_1 = (t * eh) / ew t_2 = eh * math.sin(t) tmp = 0 if (eh <= -1.75e+122) or not (eh <= 5.2e-69): tmp = math.fabs((ew - (t_2 * math.sin(math.atan(((t * -eh) / ew)))))) else: tmp = math.fabs(((ew * math.cos(t)) - (t_1 * (t_2 / math.hypot(1.0, t_1))))) return tmp
function code(eh, ew, t) t_1 = Float64(Float64(t * eh) / ew) t_2 = Float64(eh * sin(t)) tmp = 0.0 if ((eh <= -1.75e+122) || !(eh <= 5.2e-69)) tmp = abs(Float64(ew - Float64(t_2 * sin(atan(Float64(Float64(t * Float64(-eh)) / ew)))))); else tmp = abs(Float64(Float64(ew * cos(t)) - Float64(t_1 * Float64(t_2 / hypot(1.0, t_1))))); end return tmp end
function tmp_2 = code(eh, ew, t) t_1 = (t * eh) / ew; t_2 = eh * sin(t); tmp = 0.0; if ((eh <= -1.75e+122) || ~((eh <= 5.2e-69))) tmp = abs((ew - (t_2 * sin(atan(((t * -eh) / ew)))))); else tmp = abs(((ew * cos(t)) - (t_1 * (t_2 / hypot(1.0, t_1))))); end tmp_2 = tmp; end
code[eh_, ew_, t_] := Block[{t$95$1 = N[(N[(t * eh), $MachinePrecision] / ew), $MachinePrecision]}, Block[{t$95$2 = N[(eh * N[Sin[t], $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[eh, -1.75e+122], N[Not[LessEqual[eh, 5.2e-69]], $MachinePrecision]], N[Abs[N[(ew - N[(t$95$2 * N[Sin[N[ArcTan[N[(N[(t * (-eh)), $MachinePrecision] / ew), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Abs[N[(N[(ew * N[Cos[t], $MachinePrecision]), $MachinePrecision] - N[(t$95$1 * N[(t$95$2 / N[Sqrt[1.0 ^ 2 + t$95$1 ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t \cdot eh}{ew}\\
t_2 := eh \cdot \sin t\\
\mathbf{if}\;eh \leq -1.75 \cdot 10^{+122} \lor \neg \left(eh \leq 5.2 \cdot 10^{-69}\right):\\
\;\;\;\;\left|ew - t\_2 \cdot \sin \tan^{-1} \left(\frac{t \cdot \left(-eh\right)}{ew}\right)\right|\\
\mathbf{else}:\\
\;\;\;\;\left|ew \cdot \cos t - t\_1 \cdot \frac{t\_2}{\mathsf{hypot}\left(1, t\_1\right)}\right|\\
\end{array}
\end{array}
if eh < -1.75000000000000007e122 or 5.2000000000000004e-69 < eh Initial program 99.8%
cos-atan99.8%
hypot-1-def99.8%
associate-/l*99.8%
add-sqr-sqrt32.9%
sqrt-unprod90.6%
sqr-neg90.6%
sqrt-unprod66.9%
add-sqr-sqrt99.8%
Applied egg-rr99.8%
*-commutative99.8%
associate-*l/99.8%
associate-*r/99.8%
Simplified99.8%
Taylor expanded in t around 0 97.9%
Taylor expanded in t around 0 90.6%
Taylor expanded in t around 0 90.6%
associate-*r*99.7%
mul-1-neg99.7%
Simplified90.6%
if -1.75000000000000007e122 < eh < 5.2000000000000004e-69Initial program 99.8%
cos-atan99.8%
hypot-1-def99.8%
associate-/l*99.8%
add-sqr-sqrt70.6%
sqrt-unprod99.6%
sqr-neg99.6%
sqrt-unprod29.3%
add-sqr-sqrt99.8%
Applied egg-rr99.8%
*-commutative99.8%
associate-*l/99.8%
associate-*r/99.8%
Simplified99.8%
Taylor expanded in t around 0 99.0%
add-log-exp92.8%
*-un-lft-identity92.8%
log-prod92.8%
metadata-eval92.8%
add-log-exp99.0%
add-sqr-sqrt70.3%
sqrt-unprod97.8%
sqr-neg97.8%
sqrt-unprod28.7%
add-sqr-sqrt99.0%
Applied egg-rr99.0%
+-lft-identity99.0%
Simplified99.0%
Taylor expanded in t around 0 98.6%
sin-atan88.2%
associate-*r/88.1%
associate-/l*83.6%
hypot-1-def83.7%
associate-/l*83.6%
Applied egg-rr83.6%
*-commutative83.6%
associate-/l*84.9%
associate-*r/89.5%
associate-*r/89.7%
Simplified89.7%
Final simplification90.0%
(FPCore (eh ew t) :precision binary64 (if (<= ew -1.06e+187) (fabs (- (* ew (cos t)) (* (* t eh) (sin (atan (/ (* t eh) ew)))))) (fabs (- ew (* (* eh (sin t)) (sin (atan (/ (* t (- eh)) ew))))))))
double code(double eh, double ew, double t) {
double tmp;
if (ew <= -1.06e+187) {
tmp = fabs(((ew * cos(t)) - ((t * eh) * sin(atan(((t * eh) / ew))))));
} else {
tmp = fabs((ew - ((eh * sin(t)) * sin(atan(((t * -eh) / ew))))));
}
return tmp;
}
real(8) function code(eh, ew, t)
real(8), intent (in) :: eh
real(8), intent (in) :: ew
real(8), intent (in) :: t
real(8) :: tmp
if (ew <= (-1.06d+187)) then
tmp = abs(((ew * cos(t)) - ((t * eh) * sin(atan(((t * eh) / ew))))))
else
tmp = abs((ew - ((eh * sin(t)) * sin(atan(((t * -eh) / ew))))))
end if
code = tmp
end function
public static double code(double eh, double ew, double t) {
double tmp;
if (ew <= -1.06e+187) {
tmp = Math.abs(((ew * Math.cos(t)) - ((t * eh) * Math.sin(Math.atan(((t * eh) / ew))))));
} else {
tmp = Math.abs((ew - ((eh * Math.sin(t)) * Math.sin(Math.atan(((t * -eh) / ew))))));
}
return tmp;
}
def code(eh, ew, t): tmp = 0 if ew <= -1.06e+187: tmp = math.fabs(((ew * math.cos(t)) - ((t * eh) * math.sin(math.atan(((t * eh) / ew)))))) else: tmp = math.fabs((ew - ((eh * math.sin(t)) * math.sin(math.atan(((t * -eh) / ew)))))) return tmp
function code(eh, ew, t) tmp = 0.0 if (ew <= -1.06e+187) tmp = abs(Float64(Float64(ew * cos(t)) - Float64(Float64(t * eh) * sin(atan(Float64(Float64(t * eh) / ew)))))); else tmp = abs(Float64(ew - Float64(Float64(eh * sin(t)) * sin(atan(Float64(Float64(t * Float64(-eh)) / ew)))))); end return tmp end
function tmp_2 = code(eh, ew, t) tmp = 0.0; if (ew <= -1.06e+187) tmp = abs(((ew * cos(t)) - ((t * eh) * sin(atan(((t * eh) / ew)))))); else tmp = abs((ew - ((eh * sin(t)) * sin(atan(((t * -eh) / ew)))))); end tmp_2 = tmp; end
code[eh_, ew_, t_] := If[LessEqual[ew, -1.06e+187], N[Abs[N[(N[(ew * N[Cos[t], $MachinePrecision]), $MachinePrecision] - N[(N[(t * eh), $MachinePrecision] * N[Sin[N[ArcTan[N[(N[(t * eh), $MachinePrecision] / ew), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], 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}
\\
\begin{array}{l}
\mathbf{if}\;ew \leq -1.06 \cdot 10^{+187}:\\
\;\;\;\;\left|ew \cdot \cos t - \left(t \cdot eh\right) \cdot \sin \tan^{-1} \left(\frac{t \cdot eh}{ew}\right)\right|\\
\mathbf{else}:\\
\;\;\;\;\left|ew - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{t \cdot \left(-eh\right)}{ew}\right)\right|\\
\end{array}
\end{array}
if ew < -1.06e187Initial program 99.7%
cos-atan99.7%
hypot-1-def99.7%
associate-/l*99.7%
add-sqr-sqrt45.7%
sqrt-unprod87.7%
sqr-neg87.7%
sqrt-unprod54.0%
add-sqr-sqrt99.7%
Applied egg-rr99.7%
*-commutative99.7%
associate-*l/99.7%
associate-*r/99.7%
Simplified99.7%
Taylor expanded in t around 0 99.7%
add-log-exp99.7%
*-un-lft-identity99.7%
log-prod99.7%
metadata-eval99.7%
add-log-exp99.7%
add-sqr-sqrt45.7%
sqrt-unprod99.7%
sqr-neg99.7%
sqrt-unprod54.0%
add-sqr-sqrt99.7%
Applied egg-rr99.7%
+-lft-identity99.7%
Simplified99.7%
Taylor expanded in t around 0 99.7%
Taylor expanded in t around 0 95.9%
if -1.06e187 < ew Initial program 99.8%
cos-atan99.8%
hypot-1-def99.8%
associate-/l*99.8%
add-sqr-sqrt55.9%
sqrt-unprod96.7%
sqr-neg96.7%
sqrt-unprod43.9%
add-sqr-sqrt99.8%
Applied egg-rr99.8%
*-commutative99.8%
associate-*l/99.8%
associate-*r/99.8%
Simplified99.8%
Taylor expanded in t around 0 98.4%
Taylor expanded in t around 0 77.5%
Taylor expanded in t around 0 77.5%
associate-*r*99.2%
mul-1-neg99.2%
Simplified77.5%
Final simplification79.2%
(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-atan99.8%
hypot-1-def99.8%
associate-/l*99.8%
add-sqr-sqrt55.0%
sqrt-unprod95.8%
sqr-neg95.8%
sqrt-unprod44.8%
add-sqr-sqrt99.8%
Applied egg-rr99.8%
*-commutative99.8%
associate-*l/99.8%
associate-*r/99.8%
Simplified99.8%
Taylor expanded in t around 0 98.6%
Taylor expanded in t around 0 75.6%
Taylor expanded in t around 0 75.6%
associate-*r*99.2%
mul-1-neg99.2%
Simplified75.6%
Final simplification75.6%
(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 * 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 eh}{ew}\right)\right|
\end{array}
Initial program 99.8%
cos-atan99.8%
hypot-1-def99.8%
associate-/l*99.8%
add-sqr-sqrt55.0%
sqrt-unprod95.8%
sqr-neg95.8%
sqrt-unprod44.8%
add-sqr-sqrt99.8%
Applied egg-rr99.8%
*-commutative99.8%
associate-*l/99.8%
associate-*r/99.8%
Simplified99.8%
Taylor expanded in t around 0 98.6%
add-log-exp91.4%
*-un-lft-identity91.4%
log-prod91.4%
metadata-eval91.4%
add-log-exp98.6%
add-sqr-sqrt54.5%
sqrt-unprod97.8%
sqr-neg97.8%
sqrt-unprod44.0%
add-sqr-sqrt98.5%
Applied egg-rr98.5%
+-lft-identity98.5%
Simplified98.5%
Taylor expanded in t around 0 98.3%
Taylor expanded in t around 0 75.6%
Final simplification75.6%
(FPCore (eh ew t) :precision binary64 (fabs (- ew (* t (* eh (sin (atan (* (tan t) (/ eh ew)))))))))
double code(double eh, double ew, double t) {
return fabs((ew - (t * (eh * sin(atan((tan(t) * (eh / ew))))))));
}
real(8) function code(eh, ew, t)
real(8), intent (in) :: eh
real(8), intent (in) :: ew
real(8), intent (in) :: t
code = abs((ew - (t * (eh * sin(atan((tan(t) * (eh / ew))))))))
end function
public static double code(double eh, double ew, double t) {
return Math.abs((ew - (t * (eh * Math.sin(Math.atan((Math.tan(t) * (eh / ew))))))));
}
def code(eh, ew, t): return math.fabs((ew - (t * (eh * math.sin(math.atan((math.tan(t) * (eh / ew))))))))
function code(eh, ew, t) return abs(Float64(ew - Float64(t * Float64(eh * sin(atan(Float64(tan(t) * Float64(eh / ew)))))))) end
function tmp = code(eh, ew, t) tmp = abs((ew - (t * (eh * sin(atan((tan(t) * (eh / ew)))))))); end
code[eh_, ew_, t_] := N[Abs[N[(ew - N[(t * N[(eh * N[Sin[N[ArcTan[N[(N[Tan[t], $MachinePrecision] * N[(eh / ew), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\left|ew - t \cdot \left(eh \cdot \sin \tan^{-1} \left(\tan t \cdot \frac{eh}{ew}\right)\right)\right|
\end{array}
Initial program 99.8%
cos-atan99.8%
hypot-1-def99.8%
associate-/l*99.8%
add-sqr-sqrt55.0%
sqrt-unprod95.8%
sqr-neg95.8%
sqrt-unprod44.8%
add-sqr-sqrt99.8%
Applied egg-rr99.8%
*-commutative99.8%
associate-*l/99.8%
associate-*r/99.8%
Simplified99.8%
Taylor expanded in t around 0 98.6%
Taylor expanded in t around 0 75.6%
Taylor expanded in t around 0 51.0%
associate-*r*50.9%
*-commutative50.9%
associate-*r*51.1%
mul-1-neg51.1%
associate-*r/51.1%
distribute-rgt-neg-in51.1%
Simplified51.1%
add-sqr-sqrt31.9%
sqrt-unprod49.5%
sqr-neg49.5%
sqrt-unprod27.8%
add-sqr-sqrt51.0%
clear-num51.0%
un-div-inv51.0%
Applied egg-rr51.0%
associate-/r/51.0%
Simplified51.0%
Final simplification51.0%
(FPCore (eh ew t) :precision binary64 (fabs (- ew (* (* t eh) (sin (atan (* eh (/ t (- ew)))))))))
double code(double eh, double ew, double t) {
return fabs((ew - ((t * eh) * 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 - ((t * eh) * sin(atan((eh * (t / -ew)))))))
end function
public static double code(double eh, double ew, double t) {
return Math.abs((ew - ((t * eh) * Math.sin(Math.atan((eh * (t / -ew)))))));
}
def code(eh, ew, t): return math.fabs((ew - ((t * eh) * math.sin(math.atan((eh * (t / -ew)))))))
function code(eh, ew, t) return abs(Float64(ew - Float64(Float64(t * eh) * sin(atan(Float64(eh * Float64(t / Float64(-ew)))))))) end
function tmp = code(eh, ew, t) tmp = abs((ew - ((t * eh) * sin(atan((eh * (t / -ew))))))); end
code[eh_, ew_, t_] := N[Abs[N[(ew - N[(N[(t * eh), $MachinePrecision] * N[Sin[N[ArcTan[N[(eh * N[(t / (-ew)), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\left|ew - \left(t \cdot eh\right) \cdot \sin \tan^{-1} \left(eh \cdot \frac{t}{-ew}\right)\right|
\end{array}
Initial program 99.8%
cos-atan99.8%
hypot-1-def99.8%
associate-/l*99.8%
add-sqr-sqrt55.0%
sqrt-unprod95.8%
sqr-neg95.8%
sqrt-unprod44.8%
add-sqr-sqrt99.8%
Applied egg-rr99.8%
*-commutative99.8%
associate-*l/99.8%
associate-*r/99.8%
Simplified99.8%
Taylor expanded in t around 0 98.6%
Taylor expanded in t around 0 75.6%
Taylor expanded in t around 0 51.0%
associate-*r*50.9%
*-commutative50.9%
associate-*r*51.1%
mul-1-neg51.1%
associate-*r/51.1%
distribute-rgt-neg-in51.1%
Simplified51.1%
Taylor expanded in t around 0 49.8%
mul-1-neg49.8%
*-commutative49.8%
associate-*r/49.8%
distribute-rgt-neg-in49.8%
distribute-frac-neg249.8%
Simplified49.8%
Taylor expanded in ew around 0 49.8%
*-commutative49.8%
*-commutative49.8%
associate-*l*49.8%
mul-1-neg49.8%
associate-/l*49.8%
distribute-rgt-neg-in49.8%
distribute-frac-neg249.8%
*-commutative49.8%
Simplified49.8%
Final simplification49.8%
(FPCore (eh ew t) :precision binary64 (fabs (- ew (* t (* eh (* (/ t ew) (/ eh (hypot 1.0 (* eh (/ t ew))))))))))
double code(double eh, double ew, double t) {
return fabs((ew - (t * (eh * ((t / ew) * (eh / hypot(1.0, (eh * (t / ew)))))))));
}
public static double code(double eh, double ew, double t) {
return Math.abs((ew - (t * (eh * ((t / ew) * (eh / Math.hypot(1.0, (eh * (t / ew)))))))));
}
def code(eh, ew, t): return math.fabs((ew - (t * (eh * ((t / ew) * (eh / math.hypot(1.0, (eh * (t / ew)))))))))
function code(eh, ew, t) return abs(Float64(ew - Float64(t * Float64(eh * Float64(Float64(t / ew) * Float64(eh / hypot(1.0, Float64(eh * Float64(t / ew))))))))) end
function tmp = code(eh, ew, t) tmp = abs((ew - (t * (eh * ((t / ew) * (eh / hypot(1.0, (eh * (t / ew))))))))); end
code[eh_, ew_, t_] := N[Abs[N[(ew - N[(t * N[(eh * N[(N[(t / ew), $MachinePrecision] * N[(eh / N[Sqrt[1.0 ^ 2 + N[(eh * N[(t / ew), $MachinePrecision]), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\left|ew - t \cdot \left(eh \cdot \left(\frac{t}{ew} \cdot \frac{eh}{\mathsf{hypot}\left(1, eh \cdot \frac{t}{ew}\right)}\right)\right)\right|
\end{array}
Initial program 99.8%
cos-atan99.8%
hypot-1-def99.8%
associate-/l*99.8%
add-sqr-sqrt55.0%
sqrt-unprod95.8%
sqr-neg95.8%
sqrt-unprod44.8%
add-sqr-sqrt99.8%
Applied egg-rr99.8%
*-commutative99.8%
associate-*l/99.8%
associate-*r/99.8%
Simplified99.8%
Taylor expanded in t around 0 98.6%
Taylor expanded in t around 0 75.6%
Taylor expanded in t around 0 51.0%
associate-*r*50.9%
*-commutative50.9%
associate-*r*51.1%
mul-1-neg51.1%
associate-*r/51.1%
distribute-rgt-neg-in51.1%
Simplified51.1%
Taylor expanded in t around 0 49.8%
mul-1-neg49.8%
*-commutative49.8%
associate-*r/49.8%
distribute-rgt-neg-in49.8%
distribute-frac-neg249.8%
Simplified49.8%
sin-atan42.4%
associate-*r/41.0%
associate-*r/40.9%
add-sqr-sqrt19.9%
sqrt-unprod32.1%
sqr-neg32.1%
sqrt-unprod21.1%
add-sqr-sqrt40.9%
associate-/l*41.0%
hypot-1-def42.2%
associate-*r/42.2%
add-sqr-sqrt20.4%
sqrt-unprod35.7%
sqr-neg35.7%
sqrt-unprod21.8%
add-sqr-sqrt42.2%
associate-/l*42.2%
Applied egg-rr42.2%
associate-/l*44.1%
associate-*r/44.2%
associate-*l/44.1%
associate-*r/44.3%
associate-*r/47.4%
*-commutative47.4%
associate-/l*47.3%
Simplified47.3%
Final simplification47.3%
(FPCore (eh ew t)
:precision binary64
(if (or (<= eh -8.8e+210)
(not
(or (<= eh 2.5e+85) (and (not (<= eh 7.8e+236)) (<= eh 5.2e+260)))))
(fabs (* t eh))
(fabs ew)))
double code(double eh, double ew, double t) {
double tmp;
if ((eh <= -8.8e+210) || !((eh <= 2.5e+85) || (!(eh <= 7.8e+236) && (eh <= 5.2e+260)))) {
tmp = fabs((t * eh));
} else {
tmp = fabs(ew);
}
return tmp;
}
real(8) function code(eh, ew, t)
real(8), intent (in) :: eh
real(8), intent (in) :: ew
real(8), intent (in) :: t
real(8) :: tmp
if ((eh <= (-8.8d+210)) .or. (.not. (eh <= 2.5d+85) .or. (.not. (eh <= 7.8d+236)) .and. (eh <= 5.2d+260))) then
tmp = abs((t * eh))
else
tmp = abs(ew)
end if
code = tmp
end function
public static double code(double eh, double ew, double t) {
double tmp;
if ((eh <= -8.8e+210) || !((eh <= 2.5e+85) || (!(eh <= 7.8e+236) && (eh <= 5.2e+260)))) {
tmp = Math.abs((t * eh));
} else {
tmp = Math.abs(ew);
}
return tmp;
}
def code(eh, ew, t): tmp = 0 if (eh <= -8.8e+210) or not ((eh <= 2.5e+85) or (not (eh <= 7.8e+236) and (eh <= 5.2e+260))): tmp = math.fabs((t * eh)) else: tmp = math.fabs(ew) return tmp
function code(eh, ew, t) tmp = 0.0 if ((eh <= -8.8e+210) || !((eh <= 2.5e+85) || (!(eh <= 7.8e+236) && (eh <= 5.2e+260)))) tmp = abs(Float64(t * eh)); else tmp = abs(ew); end return tmp end
function tmp_2 = code(eh, ew, t) tmp = 0.0; if ((eh <= -8.8e+210) || ~(((eh <= 2.5e+85) || (~((eh <= 7.8e+236)) && (eh <= 5.2e+260))))) tmp = abs((t * eh)); else tmp = abs(ew); end tmp_2 = tmp; end
code[eh_, ew_, t_] := If[Or[LessEqual[eh, -8.8e+210], N[Not[Or[LessEqual[eh, 2.5e+85], And[N[Not[LessEqual[eh, 7.8e+236]], $MachinePrecision], LessEqual[eh, 5.2e+260]]]], $MachinePrecision]], N[Abs[N[(t * eh), $MachinePrecision]], $MachinePrecision], N[Abs[ew], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;eh \leq -8.8 \cdot 10^{+210} \lor \neg \left(eh \leq 2.5 \cdot 10^{+85} \lor \neg \left(eh \leq 7.8 \cdot 10^{+236}\right) \land eh \leq 5.2 \cdot 10^{+260}\right):\\
\;\;\;\;\left|t \cdot eh\right|\\
\mathbf{else}:\\
\;\;\;\;\left|ew\right|\\
\end{array}
\end{array}
if eh < -8.79999999999999948e210 or 2.5e85 < eh < 7.8000000000000001e236 or 5.1999999999999996e260 < eh Initial program 99.8%
cos-atan99.8%
hypot-1-def99.8%
associate-/l*99.8%
add-sqr-sqrt34.5%
sqrt-unprod90.3%
sqr-neg90.3%
sqrt-unprod65.3%
add-sqr-sqrt99.8%
Applied egg-rr99.8%
*-commutative99.8%
associate-*l/99.8%
associate-*r/99.8%
Simplified99.8%
Taylor expanded in t around 0 97.6%
Taylor expanded in t around 0 94.3%
Taylor expanded in t around 0 48.1%
associate-*r*48.1%
*-commutative48.1%
associate-*r*48.1%
mul-1-neg48.1%
associate-*r/48.1%
distribute-rgt-neg-in48.1%
Simplified48.1%
Taylor expanded in t around 0 48.0%
mul-1-neg48.0%
*-commutative48.0%
associate-*r/48.0%
distribute-rgt-neg-in48.0%
distribute-frac-neg248.0%
Simplified48.0%
Taylor expanded in t around inf 40.8%
cancel-sign-sub-inv40.8%
cancel-sign-sub40.8%
remove-double-neg40.8%
mul-1-neg40.8%
*-commutative40.8%
associate-*r/40.8%
distribute-lft-neg-in40.8%
Simplified40.8%
*-commutative40.8%
sin-atan17.2%
associate-*l/10.7%
add-sqr-sqrt4.3%
sqrt-unprod6.2%
sqr-neg6.2%
sqrt-unprod6.3%
add-sqr-sqrt10.7%
associate-*r/10.7%
*-commutative10.7%
associate-/l*10.7%
distribute-lft-neg-out10.7%
distribute-lft-neg-out10.7%
sqr-neg10.7%
Applied egg-rr14.1%
*-commutative14.1%
associate-/l*30.8%
associate-*r/30.7%
associate-*l/19.5%
*-commutative19.5%
*-lft-identity19.5%
associate-*l/19.6%
associate-*l*30.6%
*-commutative30.6%
associate-/r/30.7%
associate-*l/30.6%
*-lft-identity30.6%
*-commutative30.6%
*-rgt-identity30.6%
associate-*l/30.6%
associate-*r/30.6%
*-commutative30.6%
associate-/r/30.6%
associate-*l/30.8%
*-lft-identity30.8%
Simplified30.8%
Taylor expanded in t around -inf 39.5%
*-commutative39.5%
Simplified39.5%
if -8.79999999999999948e210 < eh < 2.5e85 or 7.8000000000000001e236 < eh < 5.1999999999999996e260Initial program 99.8%
cos-atan99.8%
hypot-1-def99.8%
associate-/l*99.8%
add-sqr-sqrt60.2%
sqrt-unprod97.3%
sqr-neg97.3%
sqrt-unprod39.6%
add-sqr-sqrt99.8%
Applied egg-rr99.8%
*-commutative99.8%
associate-*l/99.8%
associate-*r/99.8%
Simplified99.8%
Taylor expanded in t around 0 98.8%
Taylor expanded in t around 0 70.9%
Taylor expanded in t around 0 51.7%
associate-*r*51.7%
*-commutative51.7%
associate-*r*51.8%
mul-1-neg51.8%
associate-*r/51.8%
distribute-rgt-neg-in51.8%
Simplified51.8%
Taylor expanded in t around 0 50.3%
mul-1-neg50.3%
*-commutative50.3%
associate-*r/50.3%
distribute-rgt-neg-in50.3%
distribute-frac-neg250.3%
Simplified50.3%
Taylor expanded in ew around inf 47.7%
Final simplification46.1%
(FPCore (eh ew t) :precision binary64 (if (or (<= ew -6.2e+104) (not (<= ew 2.4e-155))) (fabs ew) (fabs (* t (- (/ ew t) eh)))))
double code(double eh, double ew, double t) {
double tmp;
if ((ew <= -6.2e+104) || !(ew <= 2.4e-155)) {
tmp = fabs(ew);
} else {
tmp = fabs((t * ((ew / t) - eh)));
}
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 <= (-6.2d+104)) .or. (.not. (ew <= 2.4d-155))) then
tmp = abs(ew)
else
tmp = abs((t * ((ew / t) - eh)))
end if
code = tmp
end function
public static double code(double eh, double ew, double t) {
double tmp;
if ((ew <= -6.2e+104) || !(ew <= 2.4e-155)) {
tmp = Math.abs(ew);
} else {
tmp = Math.abs((t * ((ew / t) - eh)));
}
return tmp;
}
def code(eh, ew, t): tmp = 0 if (ew <= -6.2e+104) or not (ew <= 2.4e-155): tmp = math.fabs(ew) else: tmp = math.fabs((t * ((ew / t) - eh))) return tmp
function code(eh, ew, t) tmp = 0.0 if ((ew <= -6.2e+104) || !(ew <= 2.4e-155)) tmp = abs(ew); else tmp = abs(Float64(t * Float64(Float64(ew / t) - eh))); end return tmp end
function tmp_2 = code(eh, ew, t) tmp = 0.0; if ((ew <= -6.2e+104) || ~((ew <= 2.4e-155))) tmp = abs(ew); else tmp = abs((t * ((ew / t) - eh))); end tmp_2 = tmp; end
code[eh_, ew_, t_] := If[Or[LessEqual[ew, -6.2e+104], N[Not[LessEqual[ew, 2.4e-155]], $MachinePrecision]], N[Abs[ew], $MachinePrecision], N[Abs[N[(t * N[(N[(ew / t), $MachinePrecision] - eh), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;ew \leq -6.2 \cdot 10^{+104} \lor \neg \left(ew \leq 2.4 \cdot 10^{-155}\right):\\
\;\;\;\;\left|ew\right|\\
\mathbf{else}:\\
\;\;\;\;\left|t \cdot \left(\frac{ew}{t} - eh\right)\right|\\
\end{array}
\end{array}
if ew < -6.20000000000000033e104 or 2.4e-155 < ew Initial program 99.8%
cos-atan99.8%
hypot-1-def99.8%
associate-/l*99.8%
add-sqr-sqrt54.6%
sqrt-unprod93.8%
sqr-neg93.8%
sqrt-unprod45.2%
add-sqr-sqrt99.8%
Applied egg-rr99.8%
*-commutative99.8%
associate-*l/99.8%
associate-*r/99.8%
Simplified99.8%
Taylor expanded in t around 0 98.9%
Taylor expanded in t around 0 70.1%
Taylor expanded in t around 0 49.3%
associate-*r*49.3%
*-commutative49.3%
associate-*r*49.4%
mul-1-neg49.4%
associate-*r/49.4%
distribute-rgt-neg-in49.4%
Simplified49.4%
Taylor expanded in t around 0 48.3%
mul-1-neg48.3%
*-commutative48.3%
associate-*r/48.3%
distribute-rgt-neg-in48.3%
distribute-frac-neg248.3%
Simplified48.3%
Taylor expanded in ew around inf 46.5%
if -6.20000000000000033e104 < ew < 2.4e-155Initial program 99.9%
cos-atan99.9%
hypot-1-def99.9%
associate-/l*99.9%
add-sqr-sqrt55.5%
sqrt-unprod98.6%
sqr-neg98.6%
sqrt-unprod44.4%
add-sqr-sqrt99.9%
Applied egg-rr99.9%
*-commutative99.9%
associate-*l/99.9%
associate-*r/99.9%
Simplified99.9%
Taylor expanded in t around 0 98.1%
Taylor expanded in t around 0 83.1%
Taylor expanded in t around 0 53.2%
associate-*r*53.2%
*-commutative53.2%
associate-*r*53.3%
mul-1-neg53.3%
associate-*r/53.3%
distribute-rgt-neg-in53.3%
Simplified53.3%
Taylor expanded in t around 0 51.9%
mul-1-neg51.9%
*-commutative51.9%
associate-*r/51.9%
distribute-rgt-neg-in51.9%
distribute-frac-neg251.9%
Simplified51.9%
Taylor expanded in t around inf 51.0%
cancel-sign-sub-inv51.0%
cancel-sign-sub51.0%
remove-double-neg51.0%
mul-1-neg51.0%
*-commutative51.0%
associate-*r/51.0%
distribute-lft-neg-in51.0%
Simplified51.0%
*-commutative51.0%
sin-atan35.3%
associate-*l/33.3%
add-sqr-sqrt15.8%
sqrt-unprod31.4%
sqr-neg31.4%
sqrt-unprod17.4%
add-sqr-sqrt33.3%
associate-*r/33.4%
*-commutative33.4%
associate-/l*33.0%
distribute-lft-neg-out33.0%
distribute-lft-neg-out33.0%
sqr-neg33.0%
Applied egg-rr37.9%
*-commutative37.9%
associate-/l*45.1%
associate-*r/45.8%
associate-*l/38.5%
*-commutative38.5%
*-lft-identity38.5%
associate-*l/38.6%
associate-*l*45.0%
*-commutative45.0%
associate-/r/45.1%
associate-*l/45.4%
*-lft-identity45.4%
*-commutative45.4%
*-rgt-identity45.4%
associate-*l/45.4%
associate-*r/45.4%
*-commutative45.4%
associate-/r/45.4%
associate-*l/45.3%
*-lft-identity45.3%
Simplified45.3%
Taylor expanded in t around inf 51.0%
+-commutative51.0%
neg-mul-151.0%
unsub-neg51.0%
Simplified51.0%
Final simplification48.4%
(FPCore (eh ew t) :precision binary64 (fabs ew))
double code(double eh, double ew, double t) {
return fabs(ew);
}
real(8) function code(eh, ew, t)
real(8), intent (in) :: eh
real(8), intent (in) :: ew
real(8), intent (in) :: t
code = abs(ew)
end function
public static double code(double eh, double ew, double t) {
return Math.abs(ew);
}
def code(eh, ew, t): return math.fabs(ew)
function code(eh, ew, t) return abs(ew) end
function tmp = code(eh, ew, t) tmp = abs(ew); end
code[eh_, ew_, t_] := N[Abs[ew], $MachinePrecision]
\begin{array}{l}
\\
\left|ew\right|
\end{array}
Initial program 99.8%
cos-atan99.8%
hypot-1-def99.8%
associate-/l*99.8%
add-sqr-sqrt55.0%
sqrt-unprod95.8%
sqr-neg95.8%
sqrt-unprod44.8%
add-sqr-sqrt99.8%
Applied egg-rr99.8%
*-commutative99.8%
associate-*l/99.8%
associate-*r/99.8%
Simplified99.8%
Taylor expanded in t around 0 98.6%
Taylor expanded in t around 0 75.6%
Taylor expanded in t around 0 51.0%
associate-*r*50.9%
*-commutative50.9%
associate-*r*51.1%
mul-1-neg51.1%
associate-*r/51.1%
distribute-rgt-neg-in51.1%
Simplified51.1%
Taylor expanded in t around 0 49.8%
mul-1-neg49.8%
*-commutative49.8%
associate-*r/49.8%
distribute-rgt-neg-in49.8%
distribute-frac-neg249.8%
Simplified49.8%
Taylor expanded in ew around inf 41.0%
herbie shell --seed 2024107
(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)))))))