
(FPCore (eh ew t) :precision binary64 (let* ((t_1 (atan (/ (/ eh ew) (tan t))))) (fabs (+ (* (* ew (sin t)) (cos t_1)) (* (* eh (cos t)) (sin t_1))))))
double code(double eh, double ew, double t) {
double t_1 = atan(((eh / ew) / tan(t)));
return fabs((((ew * sin(t)) * cos(t_1)) + ((eh * cos(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 / ew) / tan(t)))
code = abs((((ew * sin(t)) * cos(t_1)) + ((eh * cos(t)) * sin(t_1))))
end function
public static double code(double eh, double ew, double t) {
double t_1 = Math.atan(((eh / ew) / Math.tan(t)));
return Math.abs((((ew * Math.sin(t)) * Math.cos(t_1)) + ((eh * Math.cos(t)) * Math.sin(t_1))));
}
def code(eh, ew, t): t_1 = math.atan(((eh / ew) / math.tan(t))) return math.fabs((((ew * math.sin(t)) * math.cos(t_1)) + ((eh * math.cos(t)) * math.sin(t_1))))
function code(eh, ew, t) t_1 = atan(Float64(Float64(eh / ew) / tan(t))) return abs(Float64(Float64(Float64(ew * sin(t)) * cos(t_1)) + Float64(Float64(eh * cos(t)) * sin(t_1)))) end
function tmp = code(eh, ew, t) t_1 = atan(((eh / ew) / tan(t))); tmp = abs((((ew * sin(t)) * cos(t_1)) + ((eh * cos(t)) * sin(t_1)))); end
code[eh_, ew_, t_] := Block[{t$95$1 = N[ArcTan[N[(N[(eh / ew), $MachinePrecision] / N[Tan[t], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, N[Abs[N[(N[(N[(ew * N[Sin[t], $MachinePrecision]), $MachinePrecision] * N[Cos[t$95$1], $MachinePrecision]), $MachinePrecision] + N[(N[(eh * N[Cos[t], $MachinePrecision]), $MachinePrecision] * N[Sin[t$95$1], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\\
\left|\left(ew \cdot \sin t\right) \cdot \cos t_1 + \left(eh \cdot \cos t\right) \cdot \sin t_1\right|
\end{array}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 13 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (eh ew t) :precision binary64 (let* ((t_1 (atan (/ (/ eh ew) (tan t))))) (fabs (+ (* (* ew (sin t)) (cos t_1)) (* (* eh (cos t)) (sin t_1))))))
double code(double eh, double ew, double t) {
double t_1 = atan(((eh / ew) / tan(t)));
return fabs((((ew * sin(t)) * cos(t_1)) + ((eh * cos(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 / ew) / tan(t)))
code = abs((((ew * sin(t)) * cos(t_1)) + ((eh * cos(t)) * sin(t_1))))
end function
public static double code(double eh, double ew, double t) {
double t_1 = Math.atan(((eh / ew) / Math.tan(t)));
return Math.abs((((ew * Math.sin(t)) * Math.cos(t_1)) + ((eh * Math.cos(t)) * Math.sin(t_1))));
}
def code(eh, ew, t): t_1 = math.atan(((eh / ew) / math.tan(t))) return math.fabs((((ew * math.sin(t)) * math.cos(t_1)) + ((eh * math.cos(t)) * math.sin(t_1))))
function code(eh, ew, t) t_1 = atan(Float64(Float64(eh / ew) / tan(t))) return abs(Float64(Float64(Float64(ew * sin(t)) * cos(t_1)) + Float64(Float64(eh * cos(t)) * sin(t_1)))) end
function tmp = code(eh, ew, t) t_1 = atan(((eh / ew) / tan(t))); tmp = abs((((ew * sin(t)) * cos(t_1)) + ((eh * cos(t)) * sin(t_1)))); end
code[eh_, ew_, t_] := Block[{t$95$1 = N[ArcTan[N[(N[(eh / ew), $MachinePrecision] / N[Tan[t], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, N[Abs[N[(N[(N[(ew * N[Sin[t], $MachinePrecision]), $MachinePrecision] * N[Cos[t$95$1], $MachinePrecision]), $MachinePrecision] + N[(N[(eh * N[Cos[t], $MachinePrecision]), $MachinePrecision] * N[Sin[t$95$1], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\\
\left|\left(ew \cdot \sin t\right) \cdot \cos t_1 + \left(eh \cdot \cos t\right) \cdot \sin t_1\right|
\end{array}
\end{array}
(FPCore (eh ew t) :precision binary64 (let* ((t_1 (atan (/ (/ eh ew) (tan t))))) (fabs (+ (* (* ew (sin t)) (cos t_1)) (* (* eh (cos t)) (sin t_1))))))
double code(double eh, double ew, double t) {
double t_1 = atan(((eh / ew) / tan(t)));
return fabs((((ew * sin(t)) * cos(t_1)) + ((eh * cos(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 / ew) / tan(t)))
code = abs((((ew * sin(t)) * cos(t_1)) + ((eh * cos(t)) * sin(t_1))))
end function
public static double code(double eh, double ew, double t) {
double t_1 = Math.atan(((eh / ew) / Math.tan(t)));
return Math.abs((((ew * Math.sin(t)) * Math.cos(t_1)) + ((eh * Math.cos(t)) * Math.sin(t_1))));
}
def code(eh, ew, t): t_1 = math.atan(((eh / ew) / math.tan(t))) return math.fabs((((ew * math.sin(t)) * math.cos(t_1)) + ((eh * math.cos(t)) * math.sin(t_1))))
function code(eh, ew, t) t_1 = atan(Float64(Float64(eh / ew) / tan(t))) return abs(Float64(Float64(Float64(ew * sin(t)) * cos(t_1)) + Float64(Float64(eh * cos(t)) * sin(t_1)))) end
function tmp = code(eh, ew, t) t_1 = atan(((eh / ew) / tan(t))); tmp = abs((((ew * sin(t)) * cos(t_1)) + ((eh * cos(t)) * sin(t_1)))); end
code[eh_, ew_, t_] := Block[{t$95$1 = N[ArcTan[N[(N[(eh / ew), $MachinePrecision] / N[Tan[t], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, N[Abs[N[(N[(N[(ew * N[Sin[t], $MachinePrecision]), $MachinePrecision] * N[Cos[t$95$1], $MachinePrecision]), $MachinePrecision] + N[(N[(eh * N[Cos[t], $MachinePrecision]), $MachinePrecision] * N[Sin[t$95$1], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\\
\left|\left(ew \cdot \sin t\right) \cdot \cos t_1 + \left(eh \cdot \cos t\right) \cdot \sin t_1\right|
\end{array}
\end{array}
Initial program 99.8%
Final simplification99.8%
(FPCore (eh ew t) :precision binary64 (fabs (+ (* (* eh (cos t)) (sin (atan (/ (/ eh ew) (tan t))))) (/ ew (/ (hypot 1.0 (/ eh (* ew (tan t)))) (sin t))))))
double code(double eh, double ew, double t) {
return fabs((((eh * cos(t)) * sin(atan(((eh / ew) / tan(t))))) + (ew / (hypot(1.0, (eh / (ew * tan(t)))) / sin(t)))));
}
public static double code(double eh, double ew, double t) {
return Math.abs((((eh * Math.cos(t)) * Math.sin(Math.atan(((eh / ew) / Math.tan(t))))) + (ew / (Math.hypot(1.0, (eh / (ew * Math.tan(t)))) / Math.sin(t)))));
}
def code(eh, ew, t): return math.fabs((((eh * math.cos(t)) * math.sin(math.atan(((eh / ew) / math.tan(t))))) + (ew / (math.hypot(1.0, (eh / (ew * math.tan(t)))) / math.sin(t)))))
function code(eh, ew, t) return abs(Float64(Float64(Float64(eh * cos(t)) * sin(atan(Float64(Float64(eh / ew) / tan(t))))) + Float64(ew / Float64(hypot(1.0, Float64(eh / Float64(ew * tan(t)))) / sin(t))))) end
function tmp = code(eh, ew, t) tmp = abs((((eh * cos(t)) * sin(atan(((eh / ew) / tan(t))))) + (ew / (hypot(1.0, (eh / (ew * tan(t)))) / sin(t))))); end
code[eh_, ew_, t_] := N[Abs[N[(N[(N[(eh * N[Cos[t], $MachinePrecision]), $MachinePrecision] * N[Sin[N[ArcTan[N[(N[(eh / ew), $MachinePrecision] / N[Tan[t], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + N[(ew / N[(N[Sqrt[1.0 ^ 2 + N[(eh / N[(ew * N[Tan[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] ^ 2], $MachinePrecision] / N[Sin[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\left|\left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right) + \frac{ew}{\frac{\mathsf{hypot}\left(1, \frac{eh}{ew \cdot \tan t}\right)}{\sin t}}\right|
\end{array}
Initial program 99.8%
expm1-log1p-u78.6%
expm1-udef67.8%
associate-*l*67.8%
associate-/l/67.8%
cos-atan70.1%
un-div-inv70.1%
hypot-1-def70.1%
associate-/l/70.1%
Applied egg-rr70.1%
expm1-def81.0%
expm1-log1p99.8%
associate-*r/99.8%
associate-/l*99.7%
associate-/l/99.7%
Simplified99.7%
Final simplification99.7%
(FPCore (eh ew t) :precision binary64 (fabs (+ (* (* eh (cos t)) (sin (atan (/ (/ eh ew) (tan t))))) (* (* ew (sin t)) (cos (atan (/ eh (* ew t))))))))
double code(double eh, double ew, double t) {
return fabs((((eh * cos(t)) * sin(atan(((eh / ew) / tan(t))))) + ((ew * sin(t)) * cos(atan((eh / (ew * t)))))));
}
real(8) function code(eh, ew, t)
real(8), intent (in) :: eh
real(8), intent (in) :: ew
real(8), intent (in) :: t
code = abs((((eh * cos(t)) * sin(atan(((eh / ew) / tan(t))))) + ((ew * sin(t)) * cos(atan((eh / (ew * t)))))))
end function
public static double code(double eh, double ew, double t) {
return Math.abs((((eh * Math.cos(t)) * Math.sin(Math.atan(((eh / ew) / Math.tan(t))))) + ((ew * Math.sin(t)) * Math.cos(Math.atan((eh / (ew * t)))))));
}
def code(eh, ew, t): return math.fabs((((eh * math.cos(t)) * math.sin(math.atan(((eh / ew) / math.tan(t))))) + ((ew * math.sin(t)) * math.cos(math.atan((eh / (ew * t)))))))
function code(eh, ew, t) return abs(Float64(Float64(Float64(eh * cos(t)) * sin(atan(Float64(Float64(eh / ew) / tan(t))))) + Float64(Float64(ew * sin(t)) * cos(atan(Float64(eh / Float64(ew * t))))))) end
function tmp = code(eh, ew, t) tmp = abs((((eh * cos(t)) * sin(atan(((eh / ew) / tan(t))))) + ((ew * sin(t)) * cos(atan((eh / (ew * t))))))); end
code[eh_, ew_, t_] := N[Abs[N[(N[(N[(eh * N[Cos[t], $MachinePrecision]), $MachinePrecision] * N[Sin[N[ArcTan[N[(N[(eh / ew), $MachinePrecision] / N[Tan[t], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + N[(N[(ew * N[Sin[t], $MachinePrecision]), $MachinePrecision] * N[Cos[N[ArcTan[N[(eh / N[(ew * t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\left|\left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right) + \left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{eh}{ew \cdot t}\right)\right|
\end{array}
Initial program 99.8%
Taylor expanded in t around 0 98.5%
Final simplification98.5%
(FPCore (eh ew t) :precision binary64 (fabs (fma (* ew (sin t)) (/ 1.0 (hypot 1.0 (/ eh (* ew (tan t))))) (* eh (cos t)))))
double code(double eh, double ew, double t) {
return fabs(fma((ew * sin(t)), (1.0 / hypot(1.0, (eh / (ew * tan(t))))), (eh * cos(t))));
}
function code(eh, ew, t) return abs(fma(Float64(ew * sin(t)), Float64(1.0 / hypot(1.0, Float64(eh / Float64(ew * tan(t))))), Float64(eh * cos(t)))) end
code[eh_, ew_, t_] := N[Abs[N[(N[(ew * N[Sin[t], $MachinePrecision]), $MachinePrecision] * N[(1.0 / N[Sqrt[1.0 ^ 2 + N[(eh / N[(ew * N[Tan[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision] + N[(eh * N[Cos[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\left|\mathsf{fma}\left(ew \cdot \sin t, \frac{1}{\mathsf{hypot}\left(1, \frac{eh}{ew \cdot \tan t}\right)}, eh \cdot \cos t\right)\right|
\end{array}
Initial program 99.8%
fma-def99.8%
associate-/l/99.8%
associate-*l*99.8%
associate-/l/99.8%
Simplified99.8%
associate-*r*99.8%
sin-atan59.7%
associate-*r/58.0%
associate-/l/58.2%
hypot-1-def63.7%
associate-/l/67.7%
Applied egg-rr67.7%
associate-*r/65.1%
associate-/l/67.5%
*-commutative67.5%
times-frac72.9%
associate-/l/68.9%
Simplified68.9%
Taylor expanded in eh around inf 98.1%
cos-atan68.9%
metadata-eval68.9%
hypot-udef68.9%
Applied egg-rr98.1%
Final simplification98.1%
(FPCore (eh ew t) :precision binary64 (fabs (+ (* ew (sin t)) (* (* eh (cos t)) (sin (atan (/ (/ eh ew) (tan t))))))))
double code(double eh, double ew, double t) {
return fabs(((ew * sin(t)) + ((eh * cos(t)) * sin(atan(((eh / ew) / tan(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 * sin(t)) + ((eh * cos(t)) * sin(atan(((eh / ew) / tan(t)))))))
end function
public static double code(double eh, double ew, double t) {
return Math.abs(((ew * Math.sin(t)) + ((eh * Math.cos(t)) * Math.sin(Math.atan(((eh / ew) / Math.tan(t)))))));
}
def code(eh, ew, t): return math.fabs(((ew * math.sin(t)) + ((eh * math.cos(t)) * math.sin(math.atan(((eh / ew) / math.tan(t)))))))
function code(eh, ew, t) return abs(Float64(Float64(ew * sin(t)) + Float64(Float64(eh * cos(t)) * sin(atan(Float64(Float64(eh / ew) / tan(t))))))) end
function tmp = code(eh, ew, t) tmp = abs(((ew * sin(t)) + ((eh * cos(t)) * sin(atan(((eh / ew) / tan(t))))))); end
code[eh_, ew_, t_] := N[Abs[N[(N[(ew * N[Sin[t], $MachinePrecision]), $MachinePrecision] + N[(N[(eh * N[Cos[t], $MachinePrecision]), $MachinePrecision] * N[Sin[N[ArcTan[N[(N[(eh / ew), $MachinePrecision] / N[Tan[t], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\left|ew \cdot \sin t + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right|
\end{array}
Initial program 99.8%
expm1-log1p-u78.6%
expm1-udef67.8%
associate-*l*67.8%
associate-/l/67.8%
cos-atan70.1%
un-div-inv70.1%
hypot-1-def70.1%
associate-/l/70.1%
Applied egg-rr70.1%
expm1-def81.0%
expm1-log1p99.8%
associate-*r/99.8%
associate-/l*99.7%
associate-/l/99.7%
Simplified99.7%
Taylor expanded in ew around inf 97.9%
Final simplification97.9%
(FPCore (eh ew t) :precision binary64 (fabs (fma (* ew (sin t)) (cos (atan (/ eh (* ew t)))) (* eh (cos t)))))
double code(double eh, double ew, double t) {
return fabs(fma((ew * sin(t)), cos(atan((eh / (ew * t)))), (eh * cos(t))));
}
function code(eh, ew, t) return abs(fma(Float64(ew * sin(t)), cos(atan(Float64(eh / Float64(ew * t)))), Float64(eh * cos(t)))) end
code[eh_, ew_, t_] := N[Abs[N[(N[(ew * N[Sin[t], $MachinePrecision]), $MachinePrecision] * N[Cos[N[ArcTan[N[(eh / N[(ew * t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] + N[(eh * N[Cos[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\left|\mathsf{fma}\left(ew \cdot \sin t, \cos \tan^{-1} \left(\frac{eh}{ew \cdot t}\right), eh \cdot \cos t\right)\right|
\end{array}
Initial program 99.8%
fma-def99.8%
associate-/l/99.8%
associate-*l*99.8%
associate-/l/99.8%
Simplified99.8%
associate-*r*99.8%
sin-atan59.7%
associate-*r/58.0%
associate-/l/58.2%
hypot-1-def63.7%
associate-/l/67.7%
Applied egg-rr67.7%
associate-*r/65.1%
associate-/l/67.5%
*-commutative67.5%
times-frac72.9%
associate-/l/68.9%
Simplified68.9%
Taylor expanded in eh around inf 98.1%
Taylor expanded in t around 0 97.4%
Final simplification97.4%
(FPCore (eh ew t)
:precision binary64
(if (or (<= ew -2.15e-80) (not (<= ew 4200000000000.0)))
(fabs (fma (* ew (sin t)) (/ 1.0 (hypot 1.0 (/ eh (* ew (tan t))))) eh))
(fabs
(+
(* (* eh (cos t)) (sin (atan (/ (/ eh ew) (tan t)))))
(/ (* ew ew) (+ (/ eh (* t t)) (* eh -0.16666666666666666)))))))
double code(double eh, double ew, double t) {
double tmp;
if ((ew <= -2.15e-80) || !(ew <= 4200000000000.0)) {
tmp = fabs(fma((ew * sin(t)), (1.0 / hypot(1.0, (eh / (ew * tan(t))))), eh));
} else {
tmp = fabs((((eh * cos(t)) * sin(atan(((eh / ew) / tan(t))))) + ((ew * ew) / ((eh / (t * t)) + (eh * -0.16666666666666666)))));
}
return tmp;
}
function code(eh, ew, t) tmp = 0.0 if ((ew <= -2.15e-80) || !(ew <= 4200000000000.0)) tmp = abs(fma(Float64(ew * sin(t)), Float64(1.0 / hypot(1.0, Float64(eh / Float64(ew * tan(t))))), eh)); else tmp = abs(Float64(Float64(Float64(eh * cos(t)) * sin(atan(Float64(Float64(eh / ew) / tan(t))))) + Float64(Float64(ew * ew) / Float64(Float64(eh / Float64(t * t)) + Float64(eh * -0.16666666666666666))))); end return tmp end
code[eh_, ew_, t_] := If[Or[LessEqual[ew, -2.15e-80], N[Not[LessEqual[ew, 4200000000000.0]], $MachinePrecision]], N[Abs[N[(N[(ew * N[Sin[t], $MachinePrecision]), $MachinePrecision] * N[(1.0 / N[Sqrt[1.0 ^ 2 + N[(eh / N[(ew * N[Tan[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision] + eh), $MachinePrecision]], $MachinePrecision], N[Abs[N[(N[(N[(eh * N[Cos[t], $MachinePrecision]), $MachinePrecision] * N[Sin[N[ArcTan[N[(N[(eh / ew), $MachinePrecision] / N[Tan[t], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + N[(N[(ew * ew), $MachinePrecision] / N[(N[(eh / N[(t * t), $MachinePrecision]), $MachinePrecision] + N[(eh * -0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;ew \leq -2.15 \cdot 10^{-80} \lor \neg \left(ew \leq 4200000000000\right):\\
\;\;\;\;\left|\mathsf{fma}\left(ew \cdot \sin t, \frac{1}{\mathsf{hypot}\left(1, \frac{eh}{ew \cdot \tan t}\right)}, eh\right)\right|\\
\mathbf{else}:\\
\;\;\;\;\left|\left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right) + \frac{ew \cdot ew}{\frac{eh}{t \cdot t} + eh \cdot -0.16666666666666666}\right|\\
\end{array}
\end{array}
if ew < -2.1500000000000001e-80 or 4.2e12 < ew Initial program 99.8%
fma-def99.8%
associate-/l/99.8%
associate-*l*99.8%
associate-/l/99.8%
Simplified99.8%
associate-*r*99.8%
sin-atan80.3%
associate-*r/77.5%
associate-/l/77.5%
hypot-1-def80.6%
associate-/l/80.8%
Applied egg-rr80.8%
associate-*r/79.5%
associate-/l/82.6%
*-commutative82.6%
times-frac86.1%
associate-/l/85.9%
Simplified85.9%
cos-atan85.9%
metadata-eval85.9%
hypot-udef85.9%
Applied egg-rr85.9%
Taylor expanded in t around 0 84.9%
if -2.1500000000000001e-80 < ew < 4.2e12Initial program 99.8%
expm1-log1p-u99.8%
expm1-udef90.3%
associate-*l*90.3%
associate-/l/90.3%
cos-atan90.3%
un-div-inv90.3%
hypot-1-def90.3%
associate-/l/90.3%
Applied egg-rr90.3%
expm1-def99.8%
expm1-log1p99.8%
associate-*r/99.8%
associate-/l*99.8%
associate-/l/99.8%
Simplified99.8%
Taylor expanded in t around 0 32.9%
associate--l+32.9%
*-commutative32.9%
unpow232.9%
fma-neg32.9%
associate-/l*32.9%
associate-*r/32.9%
unpow232.9%
unpow232.9%
*-commutative32.9%
Simplified32.9%
Taylor expanded in ew around 0 90.4%
unpow290.4%
associate--l+90.4%
unpow290.4%
distribute-rgt-out--90.4%
metadata-eval90.4%
Simplified90.4%
Final simplification87.0%
(FPCore (eh ew t)
:precision binary64
(if (or (<= ew -6e-83) (not (<= ew 1.8e-241)))
(fabs (fma (* ew (sin t)) (/ 1.0 (hypot 1.0 (/ eh (* ew (tan t))))) eh))
(fabs
(+
(* (* eh (cos t)) (sin (atan (/ (/ eh ew) (tan t)))))
(/ (* (* ew t) (* ew t)) eh)))))
double code(double eh, double ew, double t) {
double tmp;
if ((ew <= -6e-83) || !(ew <= 1.8e-241)) {
tmp = fabs(fma((ew * sin(t)), (1.0 / hypot(1.0, (eh / (ew * tan(t))))), eh));
} else {
tmp = fabs((((eh * cos(t)) * sin(atan(((eh / ew) / tan(t))))) + (((ew * t) * (ew * t)) / eh)));
}
return tmp;
}
function code(eh, ew, t) tmp = 0.0 if ((ew <= -6e-83) || !(ew <= 1.8e-241)) tmp = abs(fma(Float64(ew * sin(t)), Float64(1.0 / hypot(1.0, Float64(eh / Float64(ew * tan(t))))), eh)); else tmp = abs(Float64(Float64(Float64(eh * cos(t)) * sin(atan(Float64(Float64(eh / ew) / tan(t))))) + Float64(Float64(Float64(ew * t) * Float64(ew * t)) / eh))); end return tmp end
code[eh_, ew_, t_] := If[Or[LessEqual[ew, -6e-83], N[Not[LessEqual[ew, 1.8e-241]], $MachinePrecision]], N[Abs[N[(N[(ew * N[Sin[t], $MachinePrecision]), $MachinePrecision] * N[(1.0 / N[Sqrt[1.0 ^ 2 + N[(eh / N[(ew * N[Tan[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision] + eh), $MachinePrecision]], $MachinePrecision], N[Abs[N[(N[(N[(eh * N[Cos[t], $MachinePrecision]), $MachinePrecision] * N[Sin[N[ArcTan[N[(N[(eh / ew), $MachinePrecision] / N[Tan[t], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + N[(N[(N[(ew * t), $MachinePrecision] * N[(ew * t), $MachinePrecision]), $MachinePrecision] / eh), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;ew \leq -6 \cdot 10^{-83} \lor \neg \left(ew \leq 1.8 \cdot 10^{-241}\right):\\
\;\;\;\;\left|\mathsf{fma}\left(ew \cdot \sin t, \frac{1}{\mathsf{hypot}\left(1, \frac{eh}{ew \cdot \tan t}\right)}, eh\right)\right|\\
\mathbf{else}:\\
\;\;\;\;\left|\left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right) + \frac{\left(ew \cdot t\right) \cdot \left(ew \cdot t\right)}{eh}\right|\\
\end{array}
\end{array}
if ew < -6.00000000000000021e-83 or 1.7999999999999999e-241 < ew Initial program 99.8%
fma-def99.8%
associate-/l/99.8%
associate-*l*99.8%
associate-/l/99.8%
Simplified99.8%
associate-*r*99.8%
sin-atan71.2%
associate-*r/69.0%
associate-/l/69.0%
hypot-1-def73.5%
associate-/l/75.5%
Applied egg-rr75.5%
associate-*r/73.2%
associate-/l/76.1%
*-commutative76.1%
times-frac81.7%
associate-/l/79.7%
Simplified79.7%
cos-atan79.6%
metadata-eval79.6%
hypot-udef79.6%
Applied egg-rr79.6%
Taylor expanded in t around 0 83.6%
if -6.00000000000000021e-83 < ew < 1.7999999999999999e-241Initial program 99.7%
expm1-log1p-u99.7%
expm1-udef94.6%
associate-*l*94.6%
associate-/l/94.6%
cos-atan94.6%
un-div-inv94.6%
hypot-1-def94.6%
associate-/l/94.6%
Applied egg-rr94.6%
expm1-def99.7%
expm1-log1p99.7%
associate-*r/99.7%
associate-/l*99.7%
associate-/l/99.7%
Simplified99.7%
Taylor expanded in t around 0 75.8%
unpow275.8%
unpow275.8%
unswap-sqr82.4%
Simplified82.4%
Final simplification83.4%
(FPCore (eh ew t)
:precision binary64
(if (<= eh -9.9e+70)
(fabs
(+
(/ ew (/ eh (* ew (* t t))))
(* (* eh (cos t)) (sin (atan (/ eh (* ew t)))))))
(fabs (fma (* ew (sin t)) (/ 1.0 (hypot 1.0 (/ eh (* ew (tan t))))) eh))))
double code(double eh, double ew, double t) {
double tmp;
if (eh <= -9.9e+70) {
tmp = fabs(((ew / (eh / (ew * (t * t)))) + ((eh * cos(t)) * sin(atan((eh / (ew * t)))))));
} else {
tmp = fabs(fma((ew * sin(t)), (1.0 / hypot(1.0, (eh / (ew * tan(t))))), eh));
}
return tmp;
}
function code(eh, ew, t) tmp = 0.0 if (eh <= -9.9e+70) tmp = abs(Float64(Float64(ew / Float64(eh / Float64(ew * Float64(t * t)))) + Float64(Float64(eh * cos(t)) * sin(atan(Float64(eh / Float64(ew * t))))))); else tmp = abs(fma(Float64(ew * sin(t)), Float64(1.0 / hypot(1.0, Float64(eh / Float64(ew * tan(t))))), eh)); end return tmp end
code[eh_, ew_, t_] := If[LessEqual[eh, -9.9e+70], N[Abs[N[(N[(ew / N[(eh / N[(ew * N[(t * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(eh * N[Cos[t], $MachinePrecision]), $MachinePrecision] * N[Sin[N[ArcTan[N[(eh / N[(ew * t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Abs[N[(N[(ew * N[Sin[t], $MachinePrecision]), $MachinePrecision] * N[(1.0 / N[Sqrt[1.0 ^ 2 + N[(eh / N[(ew * N[Tan[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision] + eh), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;eh \leq -9.9 \cdot 10^{+70}:\\
\;\;\;\;\left|\frac{ew}{\frac{eh}{ew \cdot \left(t \cdot t\right)}} + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{eh}{ew \cdot t}\right)\right|\\
\mathbf{else}:\\
\;\;\;\;\left|\mathsf{fma}\left(ew \cdot \sin t, \frac{1}{\mathsf{hypot}\left(1, \frac{eh}{ew \cdot \tan t}\right)}, eh\right)\right|\\
\end{array}
\end{array}
if eh < -9.8999999999999999e70Initial program 99.8%
expm1-log1p-u81.8%
expm1-udef81.8%
associate-*l*81.8%
associate-/l/81.8%
cos-atan88.8%
un-div-inv88.8%
hypot-1-def88.8%
associate-/l/88.8%
Applied egg-rr88.8%
expm1-def88.8%
expm1-log1p99.8%
associate-*r/99.8%
associate-/l*99.9%
associate-/l/99.9%
Simplified99.9%
Taylor expanded in t around 0 72.0%
*-commutative72.0%
unpow272.0%
Simplified72.0%
Taylor expanded in t around 0 72.0%
if -9.8999999999999999e70 < eh Initial program 99.8%
fma-def99.8%
associate-/l/99.8%
associate-*l*99.8%
associate-/l/99.8%
Simplified99.8%
associate-*r*99.8%
sin-atan69.1%
associate-*r/68.9%
associate-/l/69.1%
hypot-1-def74.5%
associate-/l/79.6%
Applied egg-rr79.6%
associate-*r/76.3%
associate-/l/78.0%
*-commutative78.0%
times-frac82.6%
associate-/l/77.4%
Simplified77.4%
cos-atan77.4%
metadata-eval77.4%
hypot-udef77.4%
Applied egg-rr77.4%
Taylor expanded in t around 0 83.3%
Final simplification80.8%
(FPCore (eh ew t)
:precision binary64
(let* ((t_1 (/ eh (* ew (* t t)))) (t_2 (/ eh (* ew t))) (t_3 (* eh (cos t))))
(if (or (<= t -1.3e+154) (not (<= t 3.3e+134)))
(fabs
(+
(/
ew
(+
t_1
(-
(+ (* 0.5 (/ ew eh)) (* (/ eh ew) -0.3333333333333333))
(* (/ eh ew) -0.16666666666666666))))
(* t_3 (sin (atan (+ t_2 (* -0.3333333333333333 (/ (* t eh) ew))))))))
(fabs (+ (/ ew t_1) (* t_3 (sin (atan t_2))))))))
double code(double eh, double ew, double t) {
double t_1 = eh / (ew * (t * t));
double t_2 = eh / (ew * t);
double t_3 = eh * cos(t);
double tmp;
if ((t <= -1.3e+154) || !(t <= 3.3e+134)) {
tmp = fabs(((ew / (t_1 + (((0.5 * (ew / eh)) + ((eh / ew) * -0.3333333333333333)) - ((eh / ew) * -0.16666666666666666)))) + (t_3 * sin(atan((t_2 + (-0.3333333333333333 * ((t * eh) / ew))))))));
} else {
tmp = fabs(((ew / t_1) + (t_3 * sin(atan(t_2)))));
}
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) :: t_2
real(8) :: t_3
real(8) :: tmp
t_1 = eh / (ew * (t * t))
t_2 = eh / (ew * t)
t_3 = eh * cos(t)
if ((t <= (-1.3d+154)) .or. (.not. (t <= 3.3d+134))) then
tmp = abs(((ew / (t_1 + (((0.5d0 * (ew / eh)) + ((eh / ew) * (-0.3333333333333333d0))) - ((eh / ew) * (-0.16666666666666666d0))))) + (t_3 * sin(atan((t_2 + ((-0.3333333333333333d0) * ((t * eh) / ew))))))))
else
tmp = abs(((ew / t_1) + (t_3 * sin(atan(t_2)))))
end if
code = tmp
end function
public static double code(double eh, double ew, double t) {
double t_1 = eh / (ew * (t * t));
double t_2 = eh / (ew * t);
double t_3 = eh * Math.cos(t);
double tmp;
if ((t <= -1.3e+154) || !(t <= 3.3e+134)) {
tmp = Math.abs(((ew / (t_1 + (((0.5 * (ew / eh)) + ((eh / ew) * -0.3333333333333333)) - ((eh / ew) * -0.16666666666666666)))) + (t_3 * Math.sin(Math.atan((t_2 + (-0.3333333333333333 * ((t * eh) / ew))))))));
} else {
tmp = Math.abs(((ew / t_1) + (t_3 * Math.sin(Math.atan(t_2)))));
}
return tmp;
}
def code(eh, ew, t): t_1 = eh / (ew * (t * t)) t_2 = eh / (ew * t) t_3 = eh * math.cos(t) tmp = 0 if (t <= -1.3e+154) or not (t <= 3.3e+134): tmp = math.fabs(((ew / (t_1 + (((0.5 * (ew / eh)) + ((eh / ew) * -0.3333333333333333)) - ((eh / ew) * -0.16666666666666666)))) + (t_3 * math.sin(math.atan((t_2 + (-0.3333333333333333 * ((t * eh) / ew)))))))) else: tmp = math.fabs(((ew / t_1) + (t_3 * math.sin(math.atan(t_2))))) return tmp
function code(eh, ew, t) t_1 = Float64(eh / Float64(ew * Float64(t * t))) t_2 = Float64(eh / Float64(ew * t)) t_3 = Float64(eh * cos(t)) tmp = 0.0 if ((t <= -1.3e+154) || !(t <= 3.3e+134)) tmp = abs(Float64(Float64(ew / Float64(t_1 + Float64(Float64(Float64(0.5 * Float64(ew / eh)) + Float64(Float64(eh / ew) * -0.3333333333333333)) - Float64(Float64(eh / ew) * -0.16666666666666666)))) + Float64(t_3 * sin(atan(Float64(t_2 + Float64(-0.3333333333333333 * Float64(Float64(t * eh) / ew)))))))); else tmp = abs(Float64(Float64(ew / t_1) + Float64(t_3 * sin(atan(t_2))))); end return tmp end
function tmp_2 = code(eh, ew, t) t_1 = eh / (ew * (t * t)); t_2 = eh / (ew * t); t_3 = eh * cos(t); tmp = 0.0; if ((t <= -1.3e+154) || ~((t <= 3.3e+134))) tmp = abs(((ew / (t_1 + (((0.5 * (ew / eh)) + ((eh / ew) * -0.3333333333333333)) - ((eh / ew) * -0.16666666666666666)))) + (t_3 * sin(atan((t_2 + (-0.3333333333333333 * ((t * eh) / ew)))))))); else tmp = abs(((ew / t_1) + (t_3 * sin(atan(t_2))))); end tmp_2 = tmp; end
code[eh_, ew_, t_] := Block[{t$95$1 = N[(eh / N[(ew * N[(t * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(eh / N[(ew * t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(eh * N[Cos[t], $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t, -1.3e+154], N[Not[LessEqual[t, 3.3e+134]], $MachinePrecision]], N[Abs[N[(N[(ew / N[(t$95$1 + N[(N[(N[(0.5 * N[(ew / eh), $MachinePrecision]), $MachinePrecision] + N[(N[(eh / ew), $MachinePrecision] * -0.3333333333333333), $MachinePrecision]), $MachinePrecision] - N[(N[(eh / ew), $MachinePrecision] * -0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$3 * N[Sin[N[ArcTan[N[(t$95$2 + N[(-0.3333333333333333 * N[(N[(t * eh), $MachinePrecision] / ew), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Abs[N[(N[(ew / t$95$1), $MachinePrecision] + N[(t$95$3 * N[Sin[N[ArcTan[t$95$2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{eh}{ew \cdot \left(t \cdot t\right)}\\
t_2 := \frac{eh}{ew \cdot t}\\
t_3 := eh \cdot \cos t\\
\mathbf{if}\;t \leq -1.3 \cdot 10^{+154} \lor \neg \left(t \leq 3.3 \cdot 10^{+134}\right):\\
\;\;\;\;\left|\frac{ew}{t_1 + \left(\left(0.5 \cdot \frac{ew}{eh} + \frac{eh}{ew} \cdot -0.3333333333333333\right) - \frac{eh}{ew} \cdot -0.16666666666666666\right)} + t_3 \cdot \sin \tan^{-1} \left(t_2 + -0.3333333333333333 \cdot \frac{t \cdot eh}{ew}\right)\right|\\
\mathbf{else}:\\
\;\;\;\;\left|\frac{ew}{t_1} + t_3 \cdot \sin \tan^{-1} t_2\right|\\
\end{array}
\end{array}
if t < -1.29999999999999994e154 or 3.3e134 < t Initial program 99.6%
expm1-log1p-u67.9%
expm1-udef58.1%
associate-*l*58.1%
associate-/l/58.1%
cos-atan59.5%
un-div-inv59.5%
hypot-1-def59.5%
associate-/l/59.5%
Applied egg-rr59.5%
expm1-def69.3%
expm1-log1p99.6%
associate-*r/99.6%
associate-/l*99.5%
associate-/l/99.5%
Simplified99.5%
Taylor expanded in t around 0 40.2%
associate--l+40.2%
*-commutative40.2%
unpow240.2%
fma-neg40.2%
associate-/l*40.2%
associate-*r/40.2%
unpow240.2%
unpow240.2%
*-commutative40.2%
Simplified40.2%
Taylor expanded in ew around 0 46.4%
Taylor expanded in t around 0 46.5%
if -1.29999999999999994e154 < t < 3.3e134Initial program 99.9%
expm1-log1p-u82.7%
expm1-udef71.4%
associate-*l*71.4%
associate-/l/71.4%
cos-atan74.1%
un-div-inv74.1%
hypot-1-def74.1%
associate-/l/74.1%
Applied egg-rr74.1%
expm1-def85.4%
expm1-log1p99.9%
associate-*r/99.9%
associate-/l*99.8%
associate-/l/99.8%
Simplified99.8%
Taylor expanded in t around 0 65.2%
*-commutative65.2%
unpow265.2%
Simplified65.2%
Taylor expanded in t around 0 65.2%
Final simplification60.1%
(FPCore (eh ew t) :precision binary64 (fabs (+ (* (* eh (cos t)) (sin (atan (/ eh (* ew t))))) (* (* t t) (* ew (/ ew eh))))))
double code(double eh, double ew, double t) {
return fabs((((eh * cos(t)) * sin(atan((eh / (ew * t))))) + ((t * t) * (ew * (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((((eh * cos(t)) * sin(atan((eh / (ew * t))))) + ((t * t) * (ew * (ew / eh)))))
end function
public static double code(double eh, double ew, double t) {
return Math.abs((((eh * Math.cos(t)) * Math.sin(Math.atan((eh / (ew * t))))) + ((t * t) * (ew * (ew / eh)))));
}
def code(eh, ew, t): return math.fabs((((eh * math.cos(t)) * math.sin(math.atan((eh / (ew * t))))) + ((t * t) * (ew * (ew / eh)))))
function code(eh, ew, t) return abs(Float64(Float64(Float64(eh * cos(t)) * sin(atan(Float64(eh / Float64(ew * t))))) + Float64(Float64(t * t) * Float64(ew * Float64(ew / eh))))) end
function tmp = code(eh, ew, t) tmp = abs((((eh * cos(t)) * sin(atan((eh / (ew * t))))) + ((t * t) * (ew * (ew / eh))))); end
code[eh_, ew_, t_] := N[Abs[N[(N[(N[(eh * N[Cos[t], $MachinePrecision]), $MachinePrecision] * N[Sin[N[ArcTan[N[(eh / N[(ew * t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + N[(N[(t * t), $MachinePrecision] * N[(ew * N[(ew / eh), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\left|\left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{eh}{ew \cdot t}\right) + \left(t \cdot t\right) \cdot \left(ew \cdot \frac{ew}{eh}\right)\right|
\end{array}
Initial program 99.8%
expm1-log1p-u78.6%
expm1-udef67.8%
associate-*l*67.8%
associate-/l/67.8%
cos-atan70.1%
un-div-inv70.1%
hypot-1-def70.1%
associate-/l/70.1%
Applied egg-rr70.1%
expm1-def81.0%
expm1-log1p99.8%
associate-*r/99.8%
associate-/l*99.7%
associate-/l/99.7%
Simplified99.7%
Taylor expanded in t around 0 48.7%
*-commutative48.7%
unpow248.7%
Simplified48.7%
Taylor expanded in t around 0 48.7%
*-un-lft-identity48.7%
associate-/r/48.5%
Applied egg-rr48.5%
*-lft-identity48.5%
unpow248.5%
associate-*r*45.5%
unpow245.5%
Simplified45.5%
Final simplification45.5%
(FPCore (eh ew t) :precision binary64 (fabs (+ (* (* eh (cos t)) (sin (atan (/ eh (* ew t))))) (* (* ew (* t t)) (/ ew eh)))))
double code(double eh, double ew, double t) {
return fabs((((eh * cos(t)) * sin(atan((eh / (ew * t))))) + ((ew * (t * 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((((eh * cos(t)) * sin(atan((eh / (ew * t))))) + ((ew * (t * t)) * (ew / eh))))
end function
public static double code(double eh, double ew, double t) {
return Math.abs((((eh * Math.cos(t)) * Math.sin(Math.atan((eh / (ew * t))))) + ((ew * (t * t)) * (ew / eh))));
}
def code(eh, ew, t): return math.fabs((((eh * math.cos(t)) * math.sin(math.atan((eh / (ew * t))))) + ((ew * (t * t)) * (ew / eh))))
function code(eh, ew, t) return abs(Float64(Float64(Float64(eh * cos(t)) * sin(atan(Float64(eh / Float64(ew * t))))) + Float64(Float64(ew * Float64(t * t)) * Float64(ew / eh)))) end
function tmp = code(eh, ew, t) tmp = abs((((eh * cos(t)) * sin(atan((eh / (ew * t))))) + ((ew * (t * t)) * (ew / eh)))); end
code[eh_, ew_, t_] := N[Abs[N[(N[(N[(eh * N[Cos[t], $MachinePrecision]), $MachinePrecision] * N[Sin[N[ArcTan[N[(eh / N[(ew * t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + N[(N[(ew * N[(t * t), $MachinePrecision]), $MachinePrecision] * N[(ew / eh), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\left|\left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{eh}{ew \cdot t}\right) + \left(ew \cdot \left(t \cdot t\right)\right) \cdot \frac{ew}{eh}\right|
\end{array}
Initial program 99.8%
expm1-log1p-u78.6%
expm1-udef67.8%
associate-*l*67.8%
associate-/l/67.8%
cos-atan70.1%
un-div-inv70.1%
hypot-1-def70.1%
associate-/l/70.1%
Applied egg-rr70.1%
expm1-def81.0%
expm1-log1p99.8%
associate-*r/99.8%
associate-/l*99.7%
associate-/l/99.7%
Simplified99.7%
Taylor expanded in t around 0 48.7%
*-commutative48.7%
unpow248.7%
Simplified48.7%
Taylor expanded in t around 0 48.7%
*-un-lft-identity48.7%
associate-/r/48.5%
Applied egg-rr48.5%
*-lft-identity48.5%
Simplified48.5%
Final simplification48.5%
(FPCore (eh ew t) :precision binary64 (fabs (+ (/ ew (/ eh (* ew (* t t)))) (* (* eh (cos t)) (sin (atan (/ eh (* ew t))))))))
double code(double eh, double ew, double t) {
return fabs(((ew / (eh / (ew * (t * t)))) + ((eh * cos(t)) * sin(atan((eh / (ew * t)))))));
}
real(8) function code(eh, ew, t)
real(8), intent (in) :: eh
real(8), intent (in) :: ew
real(8), intent (in) :: t
code = abs(((ew / (eh / (ew * (t * t)))) + ((eh * cos(t)) * sin(atan((eh / (ew * t)))))))
end function
public static double code(double eh, double ew, double t) {
return Math.abs(((ew / (eh / (ew * (t * t)))) + ((eh * Math.cos(t)) * Math.sin(Math.atan((eh / (ew * t)))))));
}
def code(eh, ew, t): return math.fabs(((ew / (eh / (ew * (t * t)))) + ((eh * math.cos(t)) * math.sin(math.atan((eh / (ew * t)))))))
function code(eh, ew, t) return abs(Float64(Float64(ew / Float64(eh / Float64(ew * Float64(t * t)))) + Float64(Float64(eh * cos(t)) * sin(atan(Float64(eh / Float64(ew * t))))))) end
function tmp = code(eh, ew, t) tmp = abs(((ew / (eh / (ew * (t * t)))) + ((eh * cos(t)) * sin(atan((eh / (ew * t))))))); end
code[eh_, ew_, t_] := N[Abs[N[(N[(ew / N[(eh / N[(ew * N[(t * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(eh * N[Cos[t], $MachinePrecision]), $MachinePrecision] * N[Sin[N[ArcTan[N[(eh / N[(ew * t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\left|\frac{ew}{\frac{eh}{ew \cdot \left(t \cdot t\right)}} + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{eh}{ew \cdot t}\right)\right|
\end{array}
Initial program 99.8%
expm1-log1p-u78.6%
expm1-udef67.8%
associate-*l*67.8%
associate-/l/67.8%
cos-atan70.1%
un-div-inv70.1%
hypot-1-def70.1%
associate-/l/70.1%
Applied egg-rr70.1%
expm1-def81.0%
expm1-log1p99.8%
associate-*r/99.8%
associate-/l*99.7%
associate-/l/99.7%
Simplified99.7%
Taylor expanded in t around 0 48.7%
*-commutative48.7%
unpow248.7%
Simplified48.7%
Taylor expanded in t around 0 48.7%
Final simplification48.7%
herbie shell --seed 2023189
(FPCore (eh ew t)
:name "Example from Robby"
:precision binary64
(fabs (+ (* (* ew (sin t)) (cos (atan (/ (/ eh ew) (tan t))))) (* (* eh (cos t)) (sin (atan (/ (/ eh ew) (tan t))))))))