
(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 15 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 (fma ew (* (sin t) (cos t_1)) (* (cos t) (* eh (sin t_1)))))))
double code(double eh, double ew, double t) {
double t_1 = atan(((eh / ew) / tan(t)));
return fabs(fma(ew, (sin(t) * cos(t_1)), (cos(t) * (eh * sin(t_1)))));
}
function code(eh, ew, t) t_1 = atan(Float64(Float64(eh / ew) / tan(t))) return abs(fma(ew, Float64(sin(t) * cos(t_1)), Float64(cos(t) * Float64(eh * 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[(ew * N[(N[Sin[t], $MachinePrecision] * N[Cos[t$95$1], $MachinePrecision]), $MachinePrecision] + N[(N[Cos[t], $MachinePrecision] * N[(eh * N[Sin[t$95$1], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\\
\left|\mathsf{fma}\left(ew, \sin t \cdot \cos t_1, \cos t \cdot \left(eh \cdot \sin t_1\right)\right)\right|
\end{array}
\end{array}
Initial program 99.8%
associate-*l*99.8%
fma-def99.8%
*-commutative99.8%
associate-*l*99.8%
Simplified99.8%
Final simplification99.8%
(FPCore (eh ew t) :precision binary64 (let* ((t_1 (atan (/ (/ eh ew) (tan t))))) (fabs (+ (* (cos t_1) (* ew (sin t))) (* (sin t_1) (* eh (cos t)))))))
double code(double eh, double ew, double t) {
double t_1 = atan(((eh / ew) / tan(t)));
return fabs(((cos(t_1) * (ew * sin(t))) + (sin(t_1) * (eh * cos(t)))));
}
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(((cos(t_1) * (ew * sin(t))) + (sin(t_1) * (eh * cos(t)))))
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(((Math.cos(t_1) * (ew * Math.sin(t))) + (Math.sin(t_1) * (eh * Math.cos(t)))));
}
def code(eh, ew, t): t_1 = math.atan(((eh / ew) / math.tan(t))) return math.fabs(((math.cos(t_1) * (ew * math.sin(t))) + (math.sin(t_1) * (eh * math.cos(t)))))
function code(eh, ew, t) t_1 = atan(Float64(Float64(eh / ew) / tan(t))) return abs(Float64(Float64(cos(t_1) * Float64(ew * sin(t))) + Float64(sin(t_1) * Float64(eh * cos(t))))) end
function tmp = code(eh, ew, t) t_1 = atan(((eh / ew) / tan(t))); tmp = abs(((cos(t_1) * (ew * sin(t))) + (sin(t_1) * (eh * cos(t))))); 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[Cos[t$95$1], $MachinePrecision] * N[(ew * N[Sin[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Sin[t$95$1], $MachinePrecision] * N[(eh * N[Cos[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\\
\left|\cos t_1 \cdot \left(ew \cdot \sin t\right) + \sin t_1 \cdot \left(eh \cdot \cos t\right)\right|
\end{array}
\end{array}
Initial program 99.8%
Final simplification99.8%
(FPCore (eh ew t)
:precision binary64
(let* ((t_1 (/ (/ eh ew) (tan t))))
(fabs
(fma ew (/ (sin t) (hypot 1.0 t_1)) (* (cos t) (* eh (sin (atan t_1))))))))
double code(double eh, double ew, double t) {
double t_1 = (eh / ew) / tan(t);
return fabs(fma(ew, (sin(t) / hypot(1.0, t_1)), (cos(t) * (eh * sin(atan(t_1))))));
}
function code(eh, ew, t) t_1 = Float64(Float64(eh / ew) / tan(t)) return abs(fma(ew, Float64(sin(t) / hypot(1.0, t_1)), Float64(cos(t) * Float64(eh * sin(atan(t_1)))))) end
code[eh_, ew_, t_] := Block[{t$95$1 = N[(N[(eh / ew), $MachinePrecision] / N[Tan[t], $MachinePrecision]), $MachinePrecision]}, N[Abs[N[(ew * N[(N[Sin[t], $MachinePrecision] / N[Sqrt[1.0 ^ 2 + t$95$1 ^ 2], $MachinePrecision]), $MachinePrecision] + N[(N[Cos[t], $MachinePrecision] * N[(eh * N[Sin[N[ArcTan[t$95$1], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{\frac{eh}{ew}}{\tan t}\\
\left|\mathsf{fma}\left(ew, \frac{\sin t}{\mathsf{hypot}\left(1, t_1\right)}, \cos t \cdot \left(eh \cdot \sin \tan^{-1} t_1\right)\right)\right|
\end{array}
\end{array}
Initial program 99.8%
associate-*l*99.8%
fma-def99.8%
*-commutative99.8%
associate-*l*99.8%
Simplified99.8%
expm1-log1p-u99.8%
expm1-udef84.4%
cos-atan84.4%
un-div-inv84.4%
hypot-1-def84.4%
Applied egg-rr84.4%
expm1-def99.8%
expm1-log1p99.8%
Simplified99.8%
Final simplification99.8%
(FPCore (eh ew t)
:precision binary64
(let* ((t_1 (/ (/ eh ew) (tan t))))
(fabs
(+
(* (sin (atan t_1)) (* eh (cos t)))
(* (* ew (sin t)) (/ 1.0 (hypot 1.0 t_1)))))))
double code(double eh, double ew, double t) {
double t_1 = (eh / ew) / tan(t);
return fabs(((sin(atan(t_1)) * (eh * cos(t))) + ((ew * sin(t)) * (1.0 / hypot(1.0, t_1)))));
}
public static double code(double eh, double ew, double t) {
double t_1 = (eh / ew) / Math.tan(t);
return Math.abs(((Math.sin(Math.atan(t_1)) * (eh * Math.cos(t))) + ((ew * Math.sin(t)) * (1.0 / Math.hypot(1.0, t_1)))));
}
def code(eh, ew, t): t_1 = (eh / ew) / math.tan(t) return math.fabs(((math.sin(math.atan(t_1)) * (eh * math.cos(t))) + ((ew * math.sin(t)) * (1.0 / math.hypot(1.0, t_1)))))
function code(eh, ew, t) t_1 = Float64(Float64(eh / ew) / tan(t)) return abs(Float64(Float64(sin(atan(t_1)) * Float64(eh * cos(t))) + Float64(Float64(ew * sin(t)) * Float64(1.0 / hypot(1.0, t_1))))) end
function tmp = code(eh, ew, t) t_1 = (eh / ew) / tan(t); tmp = abs(((sin(atan(t_1)) * (eh * cos(t))) + ((ew * sin(t)) * (1.0 / hypot(1.0, t_1))))); end
code[eh_, ew_, t_] := Block[{t$95$1 = N[(N[(eh / ew), $MachinePrecision] / N[Tan[t], $MachinePrecision]), $MachinePrecision]}, N[Abs[N[(N[(N[Sin[N[ArcTan[t$95$1], $MachinePrecision]], $MachinePrecision] * N[(eh * N[Cos[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(ew * N[Sin[t], $MachinePrecision]), $MachinePrecision] * N[(1.0 / N[Sqrt[1.0 ^ 2 + t$95$1 ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{\frac{eh}{ew}}{\tan t}\\
\left|\sin \tan^{-1} t_1 \cdot \left(eh \cdot \cos t\right) + \left(ew \cdot \sin t\right) \cdot \frac{1}{\mathsf{hypot}\left(1, t_1\right)}\right|
\end{array}
\end{array}
Initial program 99.8%
cos-atan99.8%
hypot-1-def99.8%
Applied egg-rr99.8%
Final simplification99.8%
(FPCore (eh ew t) :precision binary64 (fabs (+ (* (sin (atan (/ (/ eh ew) (tan t)))) (* eh (cos t))) (* (* ew (sin t)) (cos (atan (/ eh (* ew t))))))))
double code(double eh, double ew, double t) {
return fabs(((sin(atan(((eh / ew) / tan(t)))) * (eh * cos(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(((sin(atan(((eh / ew) / tan(t)))) * (eh * cos(t))) + ((ew * sin(t)) * cos(atan((eh / (ew * t)))))))
end function
public static double code(double eh, double ew, double t) {
return Math.abs(((Math.sin(Math.atan(((eh / ew) / Math.tan(t)))) * (eh * Math.cos(t))) + ((ew * Math.sin(t)) * Math.cos(Math.atan((eh / (ew * t)))))));
}
def code(eh, ew, t): return math.fabs(((math.sin(math.atan(((eh / ew) / math.tan(t)))) * (eh * math.cos(t))) + ((ew * math.sin(t)) * math.cos(math.atan((eh / (ew * t)))))))
function code(eh, ew, t) return abs(Float64(Float64(sin(atan(Float64(Float64(eh / ew) / tan(t)))) * Float64(eh * cos(t))) + Float64(Float64(ew * sin(t)) * cos(atan(Float64(eh / Float64(ew * t))))))) end
function tmp = code(eh, ew, t) tmp = abs(((sin(atan(((eh / ew) / tan(t)))) * (eh * cos(t))) + ((ew * sin(t)) * cos(atan((eh / (ew * t))))))); end
code[eh_, ew_, t_] := N[Abs[N[(N[(N[Sin[N[ArcTan[N[(N[(eh / ew), $MachinePrecision] / N[Tan[t], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * N[(eh * N[Cos[t], $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|\sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right) \cdot \left(eh \cdot \cos 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 99.1%
Final simplification99.1%
(FPCore (eh ew t) :precision binary64 (fabs (fma ew (sin t) (* (cos t) (* eh (sin (atan (/ (/ eh ew) (tan t)))))))))
double code(double eh, double ew, double t) {
return fabs(fma(ew, sin(t), (cos(t) * (eh * sin(atan(((eh / ew) / tan(t))))))));
}
function code(eh, ew, t) return abs(fma(ew, sin(t), Float64(cos(t) * Float64(eh * sin(atan(Float64(Float64(eh / ew) / tan(t)))))))) end
code[eh_, ew_, t_] := N[Abs[N[(ew * N[Sin[t], $MachinePrecision] + N[(N[Cos[t], $MachinePrecision] * N[(eh * N[Sin[N[ArcTan[N[(N[(eh / ew), $MachinePrecision] / N[Tan[t], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\left|\mathsf{fma}\left(ew, \sin t, \cos t \cdot \left(eh \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right)\right)\right|
\end{array}
Initial program 99.8%
associate-*l*99.8%
fma-def99.8%
*-commutative99.8%
associate-*l*99.8%
Simplified99.8%
expm1-log1p-u99.8%
expm1-udef84.4%
cos-atan84.4%
un-div-inv84.4%
hypot-1-def84.4%
Applied egg-rr84.4%
expm1-def99.8%
expm1-log1p99.8%
Simplified99.8%
Taylor expanded in eh around 0 98.3%
Final simplification98.3%
(FPCore (eh ew t) :precision binary64 (fabs (+ (* ew (sin t)) (* (sin (atan (/ (/ eh ew) (tan t)))) (* eh (cos t))))))
double code(double eh, double ew, double t) {
return fabs(((ew * sin(t)) + (sin(atan(((eh / ew) / tan(t)))) * (eh * cos(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)) + (sin(atan(((eh / ew) / tan(t)))) * (eh * cos(t)))))
end function
public static double code(double eh, double ew, double t) {
return Math.abs(((ew * Math.sin(t)) + (Math.sin(Math.atan(((eh / ew) / Math.tan(t)))) * (eh * Math.cos(t)))));
}
def code(eh, ew, t): return math.fabs(((ew * math.sin(t)) + (math.sin(math.atan(((eh / ew) / math.tan(t)))) * (eh * math.cos(t)))))
function code(eh, ew, t) return abs(Float64(Float64(ew * sin(t)) + Float64(sin(atan(Float64(Float64(eh / ew) / tan(t)))) * Float64(eh * cos(t))))) end
function tmp = code(eh, ew, t) tmp = abs(((ew * sin(t)) + (sin(atan(((eh / ew) / tan(t)))) * (eh * cos(t))))); end
code[eh_, ew_, t_] := N[Abs[N[(N[(ew * N[Sin[t], $MachinePrecision]), $MachinePrecision] + N[(N[Sin[N[ArcTan[N[(N[(eh / ew), $MachinePrecision] / N[Tan[t], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * N[(eh * N[Cos[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\left|ew \cdot \sin t + \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right) \cdot \left(eh \cdot \cos t\right)\right|
\end{array}
Initial program 99.8%
cos-atan99.8%
hypot-1-def99.8%
Applied egg-rr99.8%
Taylor expanded in ew around inf 98.3%
Final simplification98.3%
(FPCore (eh ew t)
:precision binary64
(let* ((t_1 (* eh (cos t))) (t_2 (/ eh (* ew t))) (t_3 (* ew (sin t))))
(if (or (<= t -3.1e+86) (not (<= t 1.55e+78)))
(fabs
(+
t_3
(* t_1 (sin (atan (+ t_2 (* -0.3333333333333333 (/ (* t eh) ew))))))))
(fabs (+ t_3 (* t_1 (sin (atan t_2))))))))
double code(double eh, double ew, double t) {
double t_1 = eh * cos(t);
double t_2 = eh / (ew * t);
double t_3 = ew * sin(t);
double tmp;
if ((t <= -3.1e+86) || !(t <= 1.55e+78)) {
tmp = fabs((t_3 + (t_1 * sin(atan((t_2 + (-0.3333333333333333 * ((t * eh) / ew))))))));
} else {
tmp = fabs((t_3 + (t_1 * 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 * cos(t)
t_2 = eh / (ew * t)
t_3 = ew * sin(t)
if ((t <= (-3.1d+86)) .or. (.not. (t <= 1.55d+78))) then
tmp = abs((t_3 + (t_1 * sin(atan((t_2 + ((-0.3333333333333333d0) * ((t * eh) / ew))))))))
else
tmp = abs((t_3 + (t_1 * sin(atan(t_2)))))
end if
code = tmp
end function
public static double code(double eh, double ew, double t) {
double t_1 = eh * Math.cos(t);
double t_2 = eh / (ew * t);
double t_3 = ew * Math.sin(t);
double tmp;
if ((t <= -3.1e+86) || !(t <= 1.55e+78)) {
tmp = Math.abs((t_3 + (t_1 * Math.sin(Math.atan((t_2 + (-0.3333333333333333 * ((t * eh) / ew))))))));
} else {
tmp = Math.abs((t_3 + (t_1 * Math.sin(Math.atan(t_2)))));
}
return tmp;
}
def code(eh, ew, t): t_1 = eh * math.cos(t) t_2 = eh / (ew * t) t_3 = ew * math.sin(t) tmp = 0 if (t <= -3.1e+86) or not (t <= 1.55e+78): tmp = math.fabs((t_3 + (t_1 * math.sin(math.atan((t_2 + (-0.3333333333333333 * ((t * eh) / ew)))))))) else: tmp = math.fabs((t_3 + (t_1 * math.sin(math.atan(t_2))))) return tmp
function code(eh, ew, t) t_1 = Float64(eh * cos(t)) t_2 = Float64(eh / Float64(ew * t)) t_3 = Float64(ew * sin(t)) tmp = 0.0 if ((t <= -3.1e+86) || !(t <= 1.55e+78)) tmp = abs(Float64(t_3 + Float64(t_1 * sin(atan(Float64(t_2 + Float64(-0.3333333333333333 * Float64(Float64(t * eh) / ew)))))))); else tmp = abs(Float64(t_3 + Float64(t_1 * sin(atan(t_2))))); end return tmp end
function tmp_2 = code(eh, ew, t) t_1 = eh * cos(t); t_2 = eh / (ew * t); t_3 = ew * sin(t); tmp = 0.0; if ((t <= -3.1e+86) || ~((t <= 1.55e+78))) tmp = abs((t_3 + (t_1 * sin(atan((t_2 + (-0.3333333333333333 * ((t * eh) / ew)))))))); else tmp = abs((t_3 + (t_1 * sin(atan(t_2))))); end tmp_2 = tmp; end
code[eh_, ew_, t_] := Block[{t$95$1 = N[(eh * N[Cos[t], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(eh / N[(ew * t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(ew * N[Sin[t], $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t, -3.1e+86], N[Not[LessEqual[t, 1.55e+78]], $MachinePrecision]], N[Abs[N[(t$95$3 + N[(t$95$1 * 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[(t$95$3 + N[(t$95$1 * N[Sin[N[ArcTan[t$95$2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := eh \cdot \cos t\\
t_2 := \frac{eh}{ew \cdot t}\\
t_3 := ew \cdot \sin t\\
\mathbf{if}\;t \leq -3.1 \cdot 10^{+86} \lor \neg \left(t \leq 1.55 \cdot 10^{+78}\right):\\
\;\;\;\;\left|t_3 + t_1 \cdot \sin \tan^{-1} \left(t_2 + -0.3333333333333333 \cdot \frac{t \cdot eh}{ew}\right)\right|\\
\mathbf{else}:\\
\;\;\;\;\left|t_3 + t_1 \cdot \sin \tan^{-1} t_2\right|\\
\end{array}
\end{array}
if t < -3.1000000000000002e86 or 1.55e78 < t Initial program 99.6%
cos-atan99.6%
hypot-1-def99.6%
Applied egg-rr99.6%
Taylor expanded in ew around inf 97.5%
Taylor expanded in t around 0 97.0%
if -3.1000000000000002e86 < t < 1.55e78Initial program 99.9%
cos-atan99.9%
hypot-1-def99.9%
Applied egg-rr99.9%
Taylor expanded in ew around inf 98.7%
Taylor expanded in t around 0 98.7%
Final simplification98.1%
(FPCore (eh ew t)
:precision binary64
(let* ((t_1 (sin (atan (/ (/ eh ew) (tan t))))))
(if (or (<= ew -1.52e-46) (not (<= ew 1.26e-170)))
(fabs (+ (* eh t_1) (* ew (sin t))))
(fabs (* t_1 (* eh (cos t)))))))
double code(double eh, double ew, double t) {
double t_1 = sin(atan(((eh / ew) / tan(t))));
double tmp;
if ((ew <= -1.52e-46) || !(ew <= 1.26e-170)) {
tmp = fabs(((eh * t_1) + (ew * sin(t))));
} else {
tmp = fabs((t_1 * (eh * cos(t))));
}
return tmp;
}
real(8) function code(eh, ew, t)
real(8), intent (in) :: eh
real(8), intent (in) :: ew
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = sin(atan(((eh / ew) / tan(t))))
if ((ew <= (-1.52d-46)) .or. (.not. (ew <= 1.26d-170))) then
tmp = abs(((eh * t_1) + (ew * sin(t))))
else
tmp = abs((t_1 * (eh * cos(t))))
end if
code = tmp
end function
public static double code(double eh, double ew, double t) {
double t_1 = Math.sin(Math.atan(((eh / ew) / Math.tan(t))));
double tmp;
if ((ew <= -1.52e-46) || !(ew <= 1.26e-170)) {
tmp = Math.abs(((eh * t_1) + (ew * Math.sin(t))));
} else {
tmp = Math.abs((t_1 * (eh * Math.cos(t))));
}
return tmp;
}
def code(eh, ew, t): t_1 = math.sin(math.atan(((eh / ew) / math.tan(t)))) tmp = 0 if (ew <= -1.52e-46) or not (ew <= 1.26e-170): tmp = math.fabs(((eh * t_1) + (ew * math.sin(t)))) else: tmp = math.fabs((t_1 * (eh * math.cos(t)))) return tmp
function code(eh, ew, t) t_1 = sin(atan(Float64(Float64(eh / ew) / tan(t)))) tmp = 0.0 if ((ew <= -1.52e-46) || !(ew <= 1.26e-170)) tmp = abs(Float64(Float64(eh * t_1) + Float64(ew * sin(t)))); else tmp = abs(Float64(t_1 * Float64(eh * cos(t)))); end return tmp end
function tmp_2 = code(eh, ew, t) t_1 = sin(atan(((eh / ew) / tan(t)))); tmp = 0.0; if ((ew <= -1.52e-46) || ~((ew <= 1.26e-170))) tmp = abs(((eh * t_1) + (ew * sin(t)))); else tmp = abs((t_1 * (eh * cos(t)))); end tmp_2 = tmp; end
code[eh_, ew_, t_] := Block[{t$95$1 = N[Sin[N[ArcTan[N[(N[(eh / ew), $MachinePrecision] / N[Tan[t], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]}, If[Or[LessEqual[ew, -1.52e-46], N[Not[LessEqual[ew, 1.26e-170]], $MachinePrecision]], N[Abs[N[(N[(eh * t$95$1), $MachinePrecision] + N[(ew * N[Sin[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Abs[N[(t$95$1 * N[(eh * N[Cos[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\\
\mathbf{if}\;ew \leq -1.52 \cdot 10^{-46} \lor \neg \left(ew \leq 1.26 \cdot 10^{-170}\right):\\
\;\;\;\;\left|eh \cdot t_1 + ew \cdot \sin t\right|\\
\mathbf{else}:\\
\;\;\;\;\left|t_1 \cdot \left(eh \cdot \cos t\right)\right|\\
\end{array}
\end{array}
if ew < -1.52000000000000006e-46 or 1.26e-170 < ew Initial program 99.8%
cos-atan99.8%
hypot-1-def99.8%
Applied egg-rr99.8%
Taylor expanded in ew around inf 97.6%
Taylor expanded in t around 0 85.3%
if -1.52000000000000006e-46 < ew < 1.26e-170Initial program 99.8%
associate-*l*99.8%
fma-def99.8%
*-commutative99.8%
associate-*l*99.8%
Simplified99.8%
expm1-log1p-u99.8%
expm1-udef96.4%
cos-atan96.4%
un-div-inv96.4%
hypot-1-def96.4%
Applied egg-rr96.4%
expm1-def99.8%
expm1-log1p99.8%
Simplified99.8%
Taylor expanded in eh around 0 99.5%
Taylor expanded in ew around 0 91.2%
*-commutative91.2%
*-commutative91.2%
associate-/r*91.2%
associate-*r*91.2%
*-commutative91.2%
Simplified91.2%
Final simplification87.6%
(FPCore (eh ew t)
:precision binary64
(if (or (<= eh -7e-11) (not (<= eh 1.35e+64)))
(fabs (* (sin (atan (/ (/ eh ew) (tan t)))) (* eh (cos t))))
(fabs
(+
(* ew (sin t))
(*
eh
(sin
(atan (+ (/ eh (* ew t)) (* -0.3333333333333333 (/ (* t eh) ew))))))))))
double code(double eh, double ew, double t) {
double tmp;
if ((eh <= -7e-11) || !(eh <= 1.35e+64)) {
tmp = fabs((sin(atan(((eh / ew) / tan(t)))) * (eh * cos(t))));
} else {
tmp = fabs(((ew * sin(t)) + (eh * sin(atan(((eh / (ew * t)) + (-0.3333333333333333 * ((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 ((eh <= (-7d-11)) .or. (.not. (eh <= 1.35d+64))) then
tmp = abs((sin(atan(((eh / ew) / tan(t)))) * (eh * cos(t))))
else
tmp = abs(((ew * sin(t)) + (eh * sin(atan(((eh / (ew * t)) + ((-0.3333333333333333d0) * ((t * eh) / ew))))))))
end if
code = tmp
end function
public static double code(double eh, double ew, double t) {
double tmp;
if ((eh <= -7e-11) || !(eh <= 1.35e+64)) {
tmp = Math.abs((Math.sin(Math.atan(((eh / ew) / Math.tan(t)))) * (eh * Math.cos(t))));
} else {
tmp = Math.abs(((ew * Math.sin(t)) + (eh * Math.sin(Math.atan(((eh / (ew * t)) + (-0.3333333333333333 * ((t * eh) / ew))))))));
}
return tmp;
}
def code(eh, ew, t): tmp = 0 if (eh <= -7e-11) or not (eh <= 1.35e+64): tmp = math.fabs((math.sin(math.atan(((eh / ew) / math.tan(t)))) * (eh * math.cos(t)))) else: tmp = math.fabs(((ew * math.sin(t)) + (eh * math.sin(math.atan(((eh / (ew * t)) + (-0.3333333333333333 * ((t * eh) / ew)))))))) return tmp
function code(eh, ew, t) tmp = 0.0 if ((eh <= -7e-11) || !(eh <= 1.35e+64)) tmp = abs(Float64(sin(atan(Float64(Float64(eh / ew) / tan(t)))) * Float64(eh * cos(t)))); else tmp = abs(Float64(Float64(ew * sin(t)) + Float64(eh * sin(atan(Float64(Float64(eh / Float64(ew * t)) + Float64(-0.3333333333333333 * Float64(Float64(t * eh) / ew)))))))); end return tmp end
function tmp_2 = code(eh, ew, t) tmp = 0.0; if ((eh <= -7e-11) || ~((eh <= 1.35e+64))) tmp = abs((sin(atan(((eh / ew) / tan(t)))) * (eh * cos(t)))); else tmp = abs(((ew * sin(t)) + (eh * sin(atan(((eh / (ew * t)) + (-0.3333333333333333 * ((t * eh) / ew)))))))); end tmp_2 = tmp; end
code[eh_, ew_, t_] := If[Or[LessEqual[eh, -7e-11], N[Not[LessEqual[eh, 1.35e+64]], $MachinePrecision]], N[Abs[N[(N[Sin[N[ArcTan[N[(N[(eh / ew), $MachinePrecision] / N[Tan[t], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * N[(eh * N[Cos[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Abs[N[(N[(ew * N[Sin[t], $MachinePrecision]), $MachinePrecision] + N[(eh * N[Sin[N[ArcTan[N[(N[(eh / N[(ew * t), $MachinePrecision]), $MachinePrecision] + N[(-0.3333333333333333 * N[(N[(t * eh), $MachinePrecision] / ew), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;eh \leq -7 \cdot 10^{-11} \lor \neg \left(eh \leq 1.35 \cdot 10^{+64}\right):\\
\;\;\;\;\left|\sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right) \cdot \left(eh \cdot \cos t\right)\right|\\
\mathbf{else}:\\
\;\;\;\;\left|ew \cdot \sin t + eh \cdot \sin \tan^{-1} \left(\frac{eh}{ew \cdot t} + -0.3333333333333333 \cdot \frac{t \cdot eh}{ew}\right)\right|\\
\end{array}
\end{array}
if eh < -7.00000000000000038e-11 or 1.35e64 < eh Initial program 99.8%
associate-*l*99.8%
fma-def99.8%
*-commutative99.8%
associate-*l*99.8%
Simplified99.8%
expm1-log1p-u99.8%
expm1-udef96.6%
cos-atan96.6%
un-div-inv96.6%
hypot-1-def96.6%
Applied egg-rr96.6%
expm1-def99.8%
expm1-log1p99.8%
Simplified99.8%
Taylor expanded in eh around 0 98.5%
Taylor expanded in ew around 0 87.6%
*-commutative87.6%
*-commutative87.6%
associate-/r*87.6%
associate-*r*87.6%
*-commutative87.6%
Simplified87.6%
if -7.00000000000000038e-11 < eh < 1.35e64Initial program 99.8%
cos-atan99.8%
hypot-1-def99.8%
Applied egg-rr99.8%
Taylor expanded in ew around inf 98.1%
Taylor expanded in t around 0 87.3%
Taylor expanded in t around 0 87.3%
Final simplification87.4%
(FPCore (eh ew t) :precision binary64 (fabs (+ (* ew (sin t)) (* (* eh (cos t)) (sin (atan (/ eh (* ew t))))))))
double code(double eh, double ew, double t) {
return fabs(((ew * sin(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 * sin(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 * Math.sin(t)) + ((eh * Math.cos(t)) * Math.sin(Math.atan((eh / (ew * t)))))));
}
def code(eh, ew, t): return math.fabs(((ew * math.sin(t)) + ((eh * math.cos(t)) * math.sin(math.atan((eh / (ew * t)))))))
function code(eh, ew, t) return abs(Float64(Float64(ew * sin(t)) + Float64(Float64(eh * cos(t)) * sin(atan(Float64(eh / Float64(ew * t))))))) end
function tmp = code(eh, ew, t) tmp = abs(((ew * sin(t)) + ((eh * cos(t)) * sin(atan((eh / (ew * 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[(eh / N[(ew * 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{eh}{ew \cdot t}\right)\right|
\end{array}
Initial program 99.8%
cos-atan99.8%
hypot-1-def99.8%
Applied egg-rr99.8%
Taylor expanded in ew around inf 98.3%
Taylor expanded in t around 0 88.0%
Final simplification88.0%
(FPCore (eh ew t)
:precision binary64
(let* ((t_1 (/ eh (* ew t)))
(t_2 (* ew (sin t)))
(t_3 (sin (atan (+ t_1 (* -0.3333333333333333 (/ (* t eh) ew)))))))
(if (<= ew 1.6e-279)
(fabs (+ t_2 (* eh (sin (atan t_1)))))
(if (<= ew 3.3e-199)
(fabs (+ (* (* eh (cos t)) t_3) (* (* ew t) (/ (* ew t) eh))))
(fabs (+ t_2 (* eh t_3)))))))
double code(double eh, double ew, double t) {
double t_1 = eh / (ew * t);
double t_2 = ew * sin(t);
double t_3 = sin(atan((t_1 + (-0.3333333333333333 * ((t * eh) / ew)))));
double tmp;
if (ew <= 1.6e-279) {
tmp = fabs((t_2 + (eh * sin(atan(t_1)))));
} else if (ew <= 3.3e-199) {
tmp = fabs((((eh * cos(t)) * t_3) + ((ew * t) * ((ew * t) / eh))));
} else {
tmp = fabs((t_2 + (eh * t_3)));
}
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_2 = ew * sin(t)
t_3 = sin(atan((t_1 + ((-0.3333333333333333d0) * ((t * eh) / ew)))))
if (ew <= 1.6d-279) then
tmp = abs((t_2 + (eh * sin(atan(t_1)))))
else if (ew <= 3.3d-199) then
tmp = abs((((eh * cos(t)) * t_3) + ((ew * t) * ((ew * t) / eh))))
else
tmp = abs((t_2 + (eh * t_3)))
end if
code = tmp
end function
public static double code(double eh, double ew, double t) {
double t_1 = eh / (ew * t);
double t_2 = ew * Math.sin(t);
double t_3 = Math.sin(Math.atan((t_1 + (-0.3333333333333333 * ((t * eh) / ew)))));
double tmp;
if (ew <= 1.6e-279) {
tmp = Math.abs((t_2 + (eh * Math.sin(Math.atan(t_1)))));
} else if (ew <= 3.3e-199) {
tmp = Math.abs((((eh * Math.cos(t)) * t_3) + ((ew * t) * ((ew * t) / eh))));
} else {
tmp = Math.abs((t_2 + (eh * t_3)));
}
return tmp;
}
def code(eh, ew, t): t_1 = eh / (ew * t) t_2 = ew * math.sin(t) t_3 = math.sin(math.atan((t_1 + (-0.3333333333333333 * ((t * eh) / ew))))) tmp = 0 if ew <= 1.6e-279: tmp = math.fabs((t_2 + (eh * math.sin(math.atan(t_1))))) elif ew <= 3.3e-199: tmp = math.fabs((((eh * math.cos(t)) * t_3) + ((ew * t) * ((ew * t) / eh)))) else: tmp = math.fabs((t_2 + (eh * t_3))) return tmp
function code(eh, ew, t) t_1 = Float64(eh / Float64(ew * t)) t_2 = Float64(ew * sin(t)) t_3 = sin(atan(Float64(t_1 + Float64(-0.3333333333333333 * Float64(Float64(t * eh) / ew))))) tmp = 0.0 if (ew <= 1.6e-279) tmp = abs(Float64(t_2 + Float64(eh * sin(atan(t_1))))); elseif (ew <= 3.3e-199) tmp = abs(Float64(Float64(Float64(eh * cos(t)) * t_3) + Float64(Float64(ew * t) * Float64(Float64(ew * t) / eh)))); else tmp = abs(Float64(t_2 + Float64(eh * t_3))); end return tmp end
function tmp_2 = code(eh, ew, t) t_1 = eh / (ew * t); t_2 = ew * sin(t); t_3 = sin(atan((t_1 + (-0.3333333333333333 * ((t * eh) / ew))))); tmp = 0.0; if (ew <= 1.6e-279) tmp = abs((t_2 + (eh * sin(atan(t_1))))); elseif (ew <= 3.3e-199) tmp = abs((((eh * cos(t)) * t_3) + ((ew * t) * ((ew * t) / eh)))); else tmp = abs((t_2 + (eh * t_3))); end tmp_2 = tmp; end
code[eh_, ew_, t_] := Block[{t$95$1 = N[(eh / N[(ew * t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(ew * N[Sin[t], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[Sin[N[ArcTan[N[(t$95$1 + N[(-0.3333333333333333 * N[(N[(t * eh), $MachinePrecision] / ew), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]}, If[LessEqual[ew, 1.6e-279], N[Abs[N[(t$95$2 + N[(eh * N[Sin[N[ArcTan[t$95$1], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[ew, 3.3e-199], N[Abs[N[(N[(N[(eh * N[Cos[t], $MachinePrecision]), $MachinePrecision] * t$95$3), $MachinePrecision] + N[(N[(ew * t), $MachinePrecision] * N[(N[(ew * t), $MachinePrecision] / eh), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Abs[N[(t$95$2 + N[(eh * t$95$3), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{eh}{ew \cdot t}\\
t_2 := ew \cdot \sin t\\
t_3 := \sin \tan^{-1} \left(t_1 + -0.3333333333333333 \cdot \frac{t \cdot eh}{ew}\right)\\
\mathbf{if}\;ew \leq 1.6 \cdot 10^{-279}:\\
\;\;\;\;\left|t_2 + eh \cdot \sin \tan^{-1} t_1\right|\\
\mathbf{elif}\;ew \leq 3.3 \cdot 10^{-199}:\\
\;\;\;\;\left|\left(eh \cdot \cos t\right) \cdot t_3 + \left(ew \cdot t\right) \cdot \frac{ew \cdot t}{eh}\right|\\
\mathbf{else}:\\
\;\;\;\;\left|t_2 + eh \cdot t_3\right|\\
\end{array}
\end{array}
if ew < 1.5999999999999999e-279Initial program 99.9%
cos-atan99.8%
hypot-1-def99.8%
Applied egg-rr99.8%
Taylor expanded in ew around inf 98.5%
Taylor expanded in t around 0 74.1%
Taylor expanded in t around 0 72.6%
if 1.5999999999999999e-279 < ew < 3.3000000000000002e-199Initial program 99.5%
cos-atan99.5%
hypot-1-def99.5%
Applied egg-rr99.5%
Taylor expanded in t around 0 74.7%
Taylor expanded in t around 0 74.7%
add-sqr-sqrt74.7%
*-un-lft-identity74.7%
times-frac74.7%
pow-prod-down74.7%
sqrt-pow174.7%
metadata-eval74.7%
pow174.7%
pow-prod-down83.6%
sqrt-pow183.6%
metadata-eval83.6%
pow183.6%
Applied egg-rr83.6%
if 3.3000000000000002e-199 < ew Initial program 99.7%
cos-atan99.7%
hypot-1-def99.7%
Applied egg-rr99.7%
Taylor expanded in ew around inf 98.0%
Taylor expanded in t around 0 84.9%
Taylor expanded in t around 0 83.7%
Final simplification77.7%
(FPCore (eh ew t) :precision binary64 (if (or (<= ew -1.42e-43) (not (<= ew 1.35e+93))) (fabs (* ew (sin t))) (fabs (* eh (sin (atan (/ (/ eh ew) (tan t))))))))
double code(double eh, double ew, double t) {
double tmp;
if ((ew <= -1.42e-43) || !(ew <= 1.35e+93)) {
tmp = fabs((ew * sin(t)));
} else {
tmp = fabs((eh * sin(atan(((eh / ew) / tan(t))))));
}
return tmp;
}
real(8) function code(eh, ew, t)
real(8), intent (in) :: eh
real(8), intent (in) :: ew
real(8), intent (in) :: t
real(8) :: tmp
if ((ew <= (-1.42d-43)) .or. (.not. (ew <= 1.35d+93))) then
tmp = abs((ew * sin(t)))
else
tmp = abs((eh * sin(atan(((eh / ew) / tan(t))))))
end if
code = tmp
end function
public static double code(double eh, double ew, double t) {
double tmp;
if ((ew <= -1.42e-43) || !(ew <= 1.35e+93)) {
tmp = Math.abs((ew * Math.sin(t)));
} else {
tmp = Math.abs((eh * Math.sin(Math.atan(((eh / ew) / Math.tan(t))))));
}
return tmp;
}
def code(eh, ew, t): tmp = 0 if (ew <= -1.42e-43) or not (ew <= 1.35e+93): tmp = math.fabs((ew * math.sin(t))) else: tmp = math.fabs((eh * math.sin(math.atan(((eh / ew) / math.tan(t)))))) return tmp
function code(eh, ew, t) tmp = 0.0 if ((ew <= -1.42e-43) || !(ew <= 1.35e+93)) tmp = abs(Float64(ew * sin(t))); else tmp = abs(Float64(eh * sin(atan(Float64(Float64(eh / ew) / tan(t)))))); end return tmp end
function tmp_2 = code(eh, ew, t) tmp = 0.0; if ((ew <= -1.42e-43) || ~((ew <= 1.35e+93))) tmp = abs((ew * sin(t))); else tmp = abs((eh * sin(atan(((eh / ew) / tan(t)))))); end tmp_2 = tmp; end
code[eh_, ew_, t_] := If[Or[LessEqual[ew, -1.42e-43], N[Not[LessEqual[ew, 1.35e+93]], $MachinePrecision]], N[Abs[N[(ew * N[Sin[t], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Abs[N[(eh * N[Sin[N[ArcTan[N[(N[(eh / ew), $MachinePrecision] / N[Tan[t], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;ew \leq -1.42 \cdot 10^{-43} \lor \neg \left(ew \leq 1.35 \cdot 10^{+93}\right):\\
\;\;\;\;\left|ew \cdot \sin t\right|\\
\mathbf{else}:\\
\;\;\;\;\left|eh \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right|\\
\end{array}
\end{array}
if ew < -1.41999999999999993e-43 or 1.35e93 < ew Initial program 99.8%
associate-*l*99.8%
fma-def99.9%
*-commutative99.9%
associate-*l*99.8%
Simplified99.8%
expm1-log1p-u99.8%
expm1-udef68.8%
cos-atan68.8%
un-div-inv68.8%
hypot-1-def68.8%
Applied egg-rr68.8%
expm1-def99.8%
expm1-log1p99.8%
Simplified99.8%
Taylor expanded in eh around 0 97.8%
Taylor expanded in ew around inf 71.5%
if -1.41999999999999993e-43 < ew < 1.35e93Initial program 99.8%
associate-*l*99.8%
fma-def99.8%
*-commutative99.8%
associate-*l*99.8%
Simplified99.8%
expm1-log1p-u99.8%
expm1-udef93.3%
cos-atan93.3%
un-div-inv93.3%
hypot-1-def93.3%
Applied egg-rr93.3%
expm1-def99.8%
expm1-log1p99.8%
Simplified99.8%
Taylor expanded in eh around 0 98.6%
Taylor expanded in t around 0 56.2%
associate-/r*56.2%
Simplified56.2%
Final simplification61.8%
(FPCore (eh ew t) :precision binary64 (fabs (+ (* ew (sin t)) (* eh (sin (atan (/ eh (* ew t))))))))
double code(double eh, double ew, double t) {
return fabs(((ew * sin(t)) + (eh * 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 * sin(t)) + (eh * sin(atan((eh / (ew * t)))))))
end function
public static double code(double eh, double ew, double t) {
return Math.abs(((ew * Math.sin(t)) + (eh * Math.sin(Math.atan((eh / (ew * t)))))));
}
def code(eh, ew, t): return math.fabs(((ew * math.sin(t)) + (eh * math.sin(math.atan((eh / (ew * t)))))))
function code(eh, ew, t) return abs(Float64(Float64(ew * sin(t)) + Float64(eh * sin(atan(Float64(eh / Float64(ew * t))))))) end
function tmp = code(eh, ew, t) tmp = abs(((ew * sin(t)) + (eh * sin(atan((eh / (ew * t))))))); end
code[eh_, ew_, t_] := N[Abs[N[(N[(ew * N[Sin[t], $MachinePrecision]), $MachinePrecision] + N[(eh * N[Sin[N[ArcTan[N[(eh / N[(ew * t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\left|ew \cdot \sin t + eh \cdot \sin \tan^{-1} \left(\frac{eh}{ew \cdot t}\right)\right|
\end{array}
Initial program 99.8%
cos-atan99.8%
hypot-1-def99.8%
Applied egg-rr99.8%
Taylor expanded in ew around inf 98.3%
Taylor expanded in t around 0 77.2%
Taylor expanded in t around 0 75.7%
Final simplification75.7%
(FPCore (eh ew t) :precision binary64 (fabs (* ew (sin t))))
double code(double eh, double ew, double t) {
return fabs((ew * sin(t)));
}
real(8) function code(eh, ew, t)
real(8), intent (in) :: eh
real(8), intent (in) :: ew
real(8), intent (in) :: t
code = abs((ew * sin(t)))
end function
public static double code(double eh, double ew, double t) {
return Math.abs((ew * Math.sin(t)));
}
def code(eh, ew, t): return math.fabs((ew * math.sin(t)))
function code(eh, ew, t) return abs(Float64(ew * sin(t))) end
function tmp = code(eh, ew, t) tmp = abs((ew * sin(t))); end
code[eh_, ew_, t_] := N[Abs[N[(ew * N[Sin[t], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\left|ew \cdot \sin t\right|
\end{array}
Initial program 99.8%
associate-*l*99.8%
fma-def99.8%
*-commutative99.8%
associate-*l*99.8%
Simplified99.8%
expm1-log1p-u99.8%
expm1-udef84.4%
cos-atan84.4%
un-div-inv84.4%
hypot-1-def84.4%
Applied egg-rr84.4%
expm1-def99.8%
expm1-log1p99.8%
Simplified99.8%
Taylor expanded in eh around 0 98.3%
Taylor expanded in ew around inf 38.6%
Final simplification38.6%
herbie shell --seed 2023301
(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))))))))