
(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 (+ (* eh (* (cos t) (sin t_1))) (* ew (* (cos t_1) (sin t)))))))
double code(double eh, double ew, double t) {
double t_1 = atan((eh / (ew * tan(t))));
return fabs(((eh * (cos(t) * sin(t_1))) + (ew * (cos(t_1) * sin(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(((eh * (cos(t) * sin(t_1))) + (ew * (cos(t_1) * sin(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(((eh * (Math.cos(t) * Math.sin(t_1))) + (ew * (Math.cos(t_1) * Math.sin(t)))));
}
def code(eh, ew, t): t_1 = math.atan((eh / (ew * math.tan(t)))) return math.fabs(((eh * (math.cos(t) * math.sin(t_1))) + (ew * (math.cos(t_1) * math.sin(t)))))
function code(eh, ew, t) t_1 = atan(Float64(eh / Float64(ew * tan(t)))) return abs(Float64(Float64(eh * Float64(cos(t) * sin(t_1))) + Float64(ew * Float64(cos(t_1) * sin(t))))) end
function tmp = code(eh, ew, t) t_1 = atan((eh / (ew * tan(t)))); tmp = abs(((eh * (cos(t) * sin(t_1))) + (ew * (cos(t_1) * sin(t))))); end
code[eh_, ew_, t_] := Block[{t$95$1 = N[ArcTan[N[(eh / N[(ew * N[Tan[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, N[Abs[N[(N[(eh * N[(N[Cos[t], $MachinePrecision] * N[Sin[t$95$1], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(ew * N[(N[Cos[t$95$1], $MachinePrecision] * N[Sin[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \tan^{-1} \left(\frac{eh}{ew \cdot \tan t}\right)\\
\left|eh \cdot \left(\cos t \cdot \sin t\_1\right) + ew \cdot \left(\cos t\_1 \cdot \sin t\right)\right|
\end{array}
\end{array}
Initial program 99.8%
fma-define99.8%
associate-/l/99.8%
associate-*l*99.8%
associate-/l/99.8%
Simplified99.8%
Taylor expanded in ew around 0 99.8%
(FPCore (eh ew t)
:precision binary64
(let* ((t_1 (/ (/ eh ew) (tan t))))
(fabs
(+
(/ (* ew (sin t)) (hypot 1.0 t_1))
(* (* eh (cos t)) (sin (atan t_1)))))))
double code(double eh, double ew, double t) {
double t_1 = (eh / ew) / tan(t);
return fabs((((ew * sin(t)) / hypot(1.0, t_1)) + ((eh * cos(t)) * sin(atan(t_1)))));
}
public static double code(double eh, double ew, double t) {
double t_1 = (eh / ew) / Math.tan(t);
return Math.abs((((ew * Math.sin(t)) / Math.hypot(1.0, t_1)) + ((eh * Math.cos(t)) * Math.sin(Math.atan(t_1)))));
}
def code(eh, ew, t): t_1 = (eh / ew) / math.tan(t) return math.fabs((((ew * math.sin(t)) / math.hypot(1.0, t_1)) + ((eh * math.cos(t)) * math.sin(math.atan(t_1)))))
function code(eh, ew, t) t_1 = Float64(Float64(eh / ew) / tan(t)) return abs(Float64(Float64(Float64(ew * sin(t)) / hypot(1.0, t_1)) + Float64(Float64(eh * cos(t)) * sin(atan(t_1))))) end
function tmp = code(eh, ew, t) t_1 = (eh / ew) / tan(t); tmp = abs((((ew * sin(t)) / hypot(1.0, t_1)) + ((eh * cos(t)) * 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[(N[(N[(ew * N[Sin[t], $MachinePrecision]), $MachinePrecision] / N[Sqrt[1.0 ^ 2 + t$95$1 ^ 2], $MachinePrecision]), $MachinePrecision] + N[(N[(eh * N[Cos[t], $MachinePrecision]), $MachinePrecision] * N[Sin[N[ArcTan[t$95$1], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{\frac{eh}{ew}}{\tan t}\\
\left|\frac{ew \cdot \sin t}{\mathsf{hypot}\left(1, t\_1\right)} + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} t\_1\right|
\end{array}
\end{array}
Initial program 99.8%
associate-/l/99.8%
cos-atan99.8%
un-div-inv99.8%
hypot-1-def99.8%
associate-/l/99.8%
Applied egg-rr99.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(eh * Float64(cos(t) * sin(atan(Float64(eh / Float64(ew * tan(t))))))) + Float64(ew / Float64(hypot(1.0, Float64(Float64(eh / 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[(eh * N[(N[Cos[t], $MachinePrecision] * N[Sin[N[ArcTan[N[(eh / N[(ew * N[Tan[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(ew / N[(N[Sqrt[1.0 ^ 2 + N[(N[(eh / ew), $MachinePrecision] / N[Tan[t], $MachinePrecision]), $MachinePrecision] ^ 2], $MachinePrecision] / N[Sin[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\left|eh \cdot \left(\cos t \cdot \sin \tan^{-1} \left(\frac{eh}{ew \cdot \tan t}\right)\right) + \frac{ew}{\frac{\mathsf{hypot}\left(1, \frac{\frac{eh}{ew}}{\tan t}\right)}{\sin t}}\right|
\end{array}
Initial program 99.8%
fma-define99.8%
associate-/l/99.8%
associate-*l*99.8%
associate-/l/99.8%
Simplified99.8%
Taylor expanded in ew around 0 99.8%
*-commutative99.8%
associate-/r*99.8%
cos-atan99.8%
hypot-1-def99.8%
div-inv99.8%
clear-num99.7%
un-div-inv99.7%
Applied egg-rr99.7%
(FPCore (eh ew t) :precision binary64 (fabs (+ (* (* eh (cos t)) (sin (atan (/ (/ eh ew) (tan t))))) (* (* ew (sin t)) (cos (atan (/ eh (* t ew))))))))
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 / (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((((eh * cos(t)) * sin(atan(((eh / ew) / tan(t))))) + ((ew * sin(t)) * cos(atan((eh / (t * ew)))))))
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 / (t * ew)))))));
}
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 / (t * ew)))))))
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(t * ew))))))) end
function tmp = code(eh, ew, t) tmp = abs((((eh * cos(t)) * sin(atan(((eh / ew) / tan(t))))) + ((ew * sin(t)) * cos(atan((eh / (t * ew))))))); 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[(t * ew), $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}{t \cdot ew}\right)\right|
\end{array}
Initial program 99.8%
Taylor expanded in t around 0 98.7%
Final simplification98.7%
(FPCore (eh ew t)
:precision binary64
(let* ((t_1 (/ (/ eh ew) (tan t))) (t_2 (sin (atan t_1))))
(if (or (<= eh -9.5e+37) (not (<= eh 9.6e+34)))
(fabs (* eh (* (cos t) t_2)))
(fabs (+ (/ (* ew (sin t)) (hypot 1.0 t_1)) (* eh t_2))))))
double code(double eh, double ew, double t) {
double t_1 = (eh / ew) / tan(t);
double t_2 = sin(atan(t_1));
double tmp;
if ((eh <= -9.5e+37) || !(eh <= 9.6e+34)) {
tmp = fabs((eh * (cos(t) * t_2)));
} else {
tmp = fabs((((ew * sin(t)) / hypot(1.0, t_1)) + (eh * t_2)));
}
return tmp;
}
public static double code(double eh, double ew, double t) {
double t_1 = (eh / ew) / Math.tan(t);
double t_2 = Math.sin(Math.atan(t_1));
double tmp;
if ((eh <= -9.5e+37) || !(eh <= 9.6e+34)) {
tmp = Math.abs((eh * (Math.cos(t) * t_2)));
} else {
tmp = Math.abs((((ew * Math.sin(t)) / Math.hypot(1.0, t_1)) + (eh * t_2)));
}
return tmp;
}
def code(eh, ew, t): t_1 = (eh / ew) / math.tan(t) t_2 = math.sin(math.atan(t_1)) tmp = 0 if (eh <= -9.5e+37) or not (eh <= 9.6e+34): tmp = math.fabs((eh * (math.cos(t) * t_2))) else: tmp = math.fabs((((ew * math.sin(t)) / math.hypot(1.0, t_1)) + (eh * t_2))) return tmp
function code(eh, ew, t) t_1 = Float64(Float64(eh / ew) / tan(t)) t_2 = sin(atan(t_1)) tmp = 0.0 if ((eh <= -9.5e+37) || !(eh <= 9.6e+34)) tmp = abs(Float64(eh * Float64(cos(t) * t_2))); else tmp = abs(Float64(Float64(Float64(ew * sin(t)) / hypot(1.0, t_1)) + Float64(eh * t_2))); end return tmp end
function tmp_2 = code(eh, ew, t) t_1 = (eh / ew) / tan(t); t_2 = sin(atan(t_1)); tmp = 0.0; if ((eh <= -9.5e+37) || ~((eh <= 9.6e+34))) tmp = abs((eh * (cos(t) * t_2))); else tmp = abs((((ew * sin(t)) / hypot(1.0, t_1)) + (eh * t_2))); end tmp_2 = tmp; end
code[eh_, ew_, t_] := Block[{t$95$1 = N[(N[(eh / ew), $MachinePrecision] / N[Tan[t], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Sin[N[ArcTan[t$95$1], $MachinePrecision]], $MachinePrecision]}, If[Or[LessEqual[eh, -9.5e+37], N[Not[LessEqual[eh, 9.6e+34]], $MachinePrecision]], N[Abs[N[(eh * N[(N[Cos[t], $MachinePrecision] * t$95$2), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Abs[N[(N[(N[(ew * N[Sin[t], $MachinePrecision]), $MachinePrecision] / N[Sqrt[1.0 ^ 2 + t$95$1 ^ 2], $MachinePrecision]), $MachinePrecision] + N[(eh * t$95$2), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{\frac{eh}{ew}}{\tan t}\\
t_2 := \sin \tan^{-1} t\_1\\
\mathbf{if}\;eh \leq -9.5 \cdot 10^{+37} \lor \neg \left(eh \leq 9.6 \cdot 10^{+34}\right):\\
\;\;\;\;\left|eh \cdot \left(\cos t \cdot t\_2\right)\right|\\
\mathbf{else}:\\
\;\;\;\;\left|\frac{ew \cdot \sin t}{\mathsf{hypot}\left(1, t\_1\right)} + eh \cdot t\_2\right|\\
\end{array}
\end{array}
if eh < -9.4999999999999995e37 or 9.59999999999999948e34 < eh Initial program 99.8%
fma-define99.8%
associate-/l/99.8%
associate-*l*99.8%
associate-/l/99.8%
Simplified99.8%
Taylor expanded in ew around inf 74.4%
Taylor expanded in ew around 0 91.2%
associate-/r*91.2%
Simplified91.2%
if -9.4999999999999995e37 < eh < 9.59999999999999948e34Initial program 99.9%
Taylor expanded in t around 0 90.0%
associate-/l/99.9%
cos-atan99.9%
un-div-inv99.9%
hypot-1-def99.9%
associate-/l/99.9%
Applied egg-rr90.0%
Final simplification90.5%
(FPCore (eh ew t)
:precision binary64
(let* ((t_1 (sin (atan (/ (/ eh ew) (tan t))))))
(if (or (<= eh -3e+38) (not (<= eh 2.35e+48)))
(fabs (* eh (* (cos t) t_1)))
(fabs (+ (* ew (sin t)) (* eh t_1))))))
double code(double eh, double ew, double t) {
double t_1 = sin(atan(((eh / ew) / tan(t))));
double tmp;
if ((eh <= -3e+38) || !(eh <= 2.35e+48)) {
tmp = fabs((eh * (cos(t) * t_1)));
} else {
tmp = fabs(((ew * sin(t)) + (eh * t_1)));
}
return tmp;
}
real(8) function code(eh, ew, t)
real(8), intent (in) :: eh
real(8), intent (in) :: ew
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = sin(atan(((eh / ew) / tan(t))))
if ((eh <= (-3d+38)) .or. (.not. (eh <= 2.35d+48))) then
tmp = abs((eh * (cos(t) * t_1)))
else
tmp = abs(((ew * sin(t)) + (eh * t_1)))
end if
code = tmp
end function
public static double code(double eh, double ew, double t) {
double t_1 = Math.sin(Math.atan(((eh / ew) / Math.tan(t))));
double tmp;
if ((eh <= -3e+38) || !(eh <= 2.35e+48)) {
tmp = Math.abs((eh * (Math.cos(t) * t_1)));
} else {
tmp = Math.abs(((ew * Math.sin(t)) + (eh * t_1)));
}
return tmp;
}
def code(eh, ew, t): t_1 = math.sin(math.atan(((eh / ew) / math.tan(t)))) tmp = 0 if (eh <= -3e+38) or not (eh <= 2.35e+48): tmp = math.fabs((eh * (math.cos(t) * t_1))) else: tmp = math.fabs(((ew * math.sin(t)) + (eh * t_1))) return tmp
function code(eh, ew, t) t_1 = sin(atan(Float64(Float64(eh / ew) / tan(t)))) tmp = 0.0 if ((eh <= -3e+38) || !(eh <= 2.35e+48)) tmp = abs(Float64(eh * Float64(cos(t) * t_1))); else tmp = abs(Float64(Float64(ew * sin(t)) + Float64(eh * t_1))); end return tmp end
function tmp_2 = code(eh, ew, t) t_1 = sin(atan(((eh / ew) / tan(t)))); tmp = 0.0; if ((eh <= -3e+38) || ~((eh <= 2.35e+48))) tmp = abs((eh * (cos(t) * t_1))); else tmp = abs(((ew * sin(t)) + (eh * t_1))); 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[eh, -3e+38], N[Not[LessEqual[eh, 2.35e+48]], $MachinePrecision]], N[Abs[N[(eh * N[(N[Cos[t], $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Abs[N[(N[(ew * N[Sin[t], $MachinePrecision]), $MachinePrecision] + N[(eh * t$95$1), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\\
\mathbf{if}\;eh \leq -3 \cdot 10^{+38} \lor \neg \left(eh \leq 2.35 \cdot 10^{+48}\right):\\
\;\;\;\;\left|eh \cdot \left(\cos t \cdot t\_1\right)\right|\\
\mathbf{else}:\\
\;\;\;\;\left|ew \cdot \sin t + eh \cdot t\_1\right|\\
\end{array}
\end{array}
if eh < -3.0000000000000001e38 or 2.35000000000000006e48 < eh Initial program 99.8%
fma-define99.8%
associate-/l/99.8%
associate-*l*99.8%
associate-/l/99.8%
Simplified99.8%
Taylor expanded in ew around inf 74.4%
Taylor expanded in ew around 0 91.2%
associate-/r*91.2%
Simplified91.2%
if -3.0000000000000001e38 < eh < 2.35000000000000006e48Initial program 99.9%
Taylor expanded in t around 0 90.0%
associate-/l/99.9%
cos-atan99.9%
un-div-inv99.9%
hypot-1-def99.9%
associate-/l/99.9%
Applied egg-rr90.0%
Taylor expanded in eh around 0 89.6%
Final simplification90.3%
(FPCore (eh ew t) :precision binary64 (if (or (<= eh -3.4e-117) (not (<= eh 1100.0))) (fabs (* eh (* (cos t) (sin (atan (/ (/ eh ew) (tan t))))))) (fabs (* ew (* (sin t) (cos (atan (/ eh (* t ew)))))))))
double code(double eh, double ew, double t) {
double tmp;
if ((eh <= -3.4e-117) || !(eh <= 1100.0)) {
tmp = fabs((eh * (cos(t) * sin(atan(((eh / ew) / tan(t)))))));
} else {
tmp = fabs((ew * (sin(t) * cos(atan((eh / (t * ew)))))));
}
return tmp;
}
real(8) function code(eh, ew, t)
real(8), intent (in) :: eh
real(8), intent (in) :: ew
real(8), intent (in) :: t
real(8) :: tmp
if ((eh <= (-3.4d-117)) .or. (.not. (eh <= 1100.0d0))) then
tmp = abs((eh * (cos(t) * sin(atan(((eh / ew) / tan(t)))))))
else
tmp = abs((ew * (sin(t) * cos(atan((eh / (t * ew)))))))
end if
code = tmp
end function
public static double code(double eh, double ew, double t) {
double tmp;
if ((eh <= -3.4e-117) || !(eh <= 1100.0)) {
tmp = Math.abs((eh * (Math.cos(t) * Math.sin(Math.atan(((eh / ew) / Math.tan(t)))))));
} else {
tmp = Math.abs((ew * (Math.sin(t) * Math.cos(Math.atan((eh / (t * ew)))))));
}
return tmp;
}
def code(eh, ew, t): tmp = 0 if (eh <= -3.4e-117) or not (eh <= 1100.0): tmp = math.fabs((eh * (math.cos(t) * math.sin(math.atan(((eh / ew) / math.tan(t))))))) else: tmp = math.fabs((ew * (math.sin(t) * math.cos(math.atan((eh / (t * ew))))))) return tmp
function code(eh, ew, t) tmp = 0.0 if ((eh <= -3.4e-117) || !(eh <= 1100.0)) tmp = abs(Float64(eh * Float64(cos(t) * sin(atan(Float64(Float64(eh / ew) / tan(t))))))); else tmp = abs(Float64(ew * Float64(sin(t) * cos(atan(Float64(eh / Float64(t * ew))))))); end return tmp end
function tmp_2 = code(eh, ew, t) tmp = 0.0; if ((eh <= -3.4e-117) || ~((eh <= 1100.0))) tmp = abs((eh * (cos(t) * sin(atan(((eh / ew) / tan(t))))))); else tmp = abs((ew * (sin(t) * cos(atan((eh / (t * ew))))))); end tmp_2 = tmp; end
code[eh_, ew_, t_] := If[Or[LessEqual[eh, -3.4e-117], N[Not[LessEqual[eh, 1100.0]], $MachinePrecision]], N[Abs[N[(eh * N[(N[Cos[t], $MachinePrecision] * N[Sin[N[ArcTan[N[(N[(eh / ew), $MachinePrecision] / N[Tan[t], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Abs[N[(ew * N[(N[Sin[t], $MachinePrecision] * N[Cos[N[ArcTan[N[(eh / N[(t * ew), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;eh \leq -3.4 \cdot 10^{-117} \lor \neg \left(eh \leq 1100\right):\\
\;\;\;\;\left|eh \cdot \left(\cos t \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right)\right|\\
\mathbf{else}:\\
\;\;\;\;\left|ew \cdot \left(\sin t \cdot \cos \tan^{-1} \left(\frac{eh}{t \cdot ew}\right)\right)\right|\\
\end{array}
\end{array}
if eh < -3.40000000000000035e-117 or 1100 < eh Initial program 99.8%
fma-define99.8%
associate-/l/99.8%
associate-*l*99.8%
associate-/l/99.8%
Simplified99.8%
Taylor expanded in ew around inf 82.0%
Taylor expanded in ew around 0 82.6%
associate-/r*82.6%
Simplified82.6%
if -3.40000000000000035e-117 < eh < 1100Initial program 99.8%
fma-define99.8%
associate-/l/99.8%
associate-*l*99.8%
associate-/l/99.8%
Simplified99.8%
Taylor expanded in ew around inf 99.8%
Taylor expanded in ew around inf 73.7%
*-commutative73.7%
associate-/r*73.7%
Simplified73.7%
Taylor expanded in t around 0 73.8%
Final simplification79.0%
(FPCore (eh ew t) :precision binary64 (if (or (<= t -7.8e-136) (not (<= t 1.65e-23))) (fabs (* ew (* (sin t) (cos (atan (/ eh (* t ew))))))) (+ (* t ew) (* eh (sin (atan (/ eh (* ew (tan t)))))))))
double code(double eh, double ew, double t) {
double tmp;
if ((t <= -7.8e-136) || !(t <= 1.65e-23)) {
tmp = fabs((ew * (sin(t) * cos(atan((eh / (t * ew)))))));
} else {
tmp = (t * ew) + (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 ((t <= (-7.8d-136)) .or. (.not. (t <= 1.65d-23))) then
tmp = abs((ew * (sin(t) * cos(atan((eh / (t * ew)))))))
else
tmp = (t * ew) + (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 ((t <= -7.8e-136) || !(t <= 1.65e-23)) {
tmp = Math.abs((ew * (Math.sin(t) * Math.cos(Math.atan((eh / (t * ew)))))));
} else {
tmp = (t * ew) + (eh * Math.sin(Math.atan((eh / (ew * Math.tan(t))))));
}
return tmp;
}
def code(eh, ew, t): tmp = 0 if (t <= -7.8e-136) or not (t <= 1.65e-23): tmp = math.fabs((ew * (math.sin(t) * math.cos(math.atan((eh / (t * ew))))))) else: tmp = (t * ew) + (eh * math.sin(math.atan((eh / (ew * math.tan(t)))))) return tmp
function code(eh, ew, t) tmp = 0.0 if ((t <= -7.8e-136) || !(t <= 1.65e-23)) tmp = abs(Float64(ew * Float64(sin(t) * cos(atan(Float64(eh / Float64(t * ew))))))); else tmp = Float64(Float64(t * ew) + Float64(eh * sin(atan(Float64(eh / Float64(ew * tan(t))))))); end return tmp end
function tmp_2 = code(eh, ew, t) tmp = 0.0; if ((t <= -7.8e-136) || ~((t <= 1.65e-23))) tmp = abs((ew * (sin(t) * cos(atan((eh / (t * ew))))))); else tmp = (t * ew) + (eh * sin(atan((eh / (ew * tan(t)))))); end tmp_2 = tmp; end
code[eh_, ew_, t_] := If[Or[LessEqual[t, -7.8e-136], N[Not[LessEqual[t, 1.65e-23]], $MachinePrecision]], N[Abs[N[(ew * N[(N[Sin[t], $MachinePrecision] * N[Cos[N[ArcTan[N[(eh / N[(t * ew), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(N[(t * ew), $MachinePrecision] + N[(eh * N[Sin[N[ArcTan[N[(eh / N[(ew * N[Tan[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -7.8 \cdot 10^{-136} \lor \neg \left(t \leq 1.65 \cdot 10^{-23}\right):\\
\;\;\;\;\left|ew \cdot \left(\sin t \cdot \cos \tan^{-1} \left(\frac{eh}{t \cdot ew}\right)\right)\right|\\
\mathbf{else}:\\
\;\;\;\;t \cdot ew + eh \cdot \sin \tan^{-1} \left(\frac{eh}{ew \cdot \tan t}\right)\\
\end{array}
\end{array}
if t < -7.79999999999999952e-136 or 1.6500000000000001e-23 < t Initial program 99.7%
fma-define99.7%
associate-/l/99.7%
associate-*l*99.7%
associate-/l/99.7%
Simplified99.7%
Taylor expanded in ew around inf 89.0%
Taylor expanded in ew around inf 48.4%
*-commutative48.4%
associate-/r*48.4%
Simplified48.4%
Taylor expanded in t around 0 48.5%
if -7.79999999999999952e-136 < t < 1.6500000000000001e-23Initial program 100.0%
fma-define100.0%
associate-/l/100.0%
associate-*l*100.0%
associate-/l/100.0%
Simplified100.0%
add-cube-cbrt97.7%
pow397.7%
Applied egg-rr54.3%
Taylor expanded in ew around inf 49.5%
*-commutative49.5%
associate-/r*49.5%
associate-*r/49.5%
associate-*l*49.5%
Simplified49.5%
Taylor expanded in t around 0 55.2%
Final simplification51.1%
(FPCore (eh ew t)
:precision binary64
(let* ((t_1 (sqrt (pow (* ew (sin t)) 2.0))))
(if (<= t -4.5e+33)
t_1
(if (<= t -4.6e-130)
(* ew (sqrt (pow (sin t) 2.0)))
(if (<= t 5.1e-23)
(+ (* t ew) (* eh (sin (atan (/ eh (* ew (tan t)))))))
t_1)))))
double code(double eh, double ew, double t) {
double t_1 = sqrt(pow((ew * sin(t)), 2.0));
double tmp;
if (t <= -4.5e+33) {
tmp = t_1;
} else if (t <= -4.6e-130) {
tmp = ew * sqrt(pow(sin(t), 2.0));
} else if (t <= 5.1e-23) {
tmp = (t * ew) + (eh * sin(atan((eh / (ew * tan(t))))));
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(eh, ew, t)
real(8), intent (in) :: eh
real(8), intent (in) :: ew
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = sqrt(((ew * sin(t)) ** 2.0d0))
if (t <= (-4.5d+33)) then
tmp = t_1
else if (t <= (-4.6d-130)) then
tmp = ew * sqrt((sin(t) ** 2.0d0))
else if (t <= 5.1d-23) then
tmp = (t * ew) + (eh * sin(atan((eh / (ew * tan(t))))))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double eh, double ew, double t) {
double t_1 = Math.sqrt(Math.pow((ew * Math.sin(t)), 2.0));
double tmp;
if (t <= -4.5e+33) {
tmp = t_1;
} else if (t <= -4.6e-130) {
tmp = ew * Math.sqrt(Math.pow(Math.sin(t), 2.0));
} else if (t <= 5.1e-23) {
tmp = (t * ew) + (eh * Math.sin(Math.atan((eh / (ew * Math.tan(t))))));
} else {
tmp = t_1;
}
return tmp;
}
def code(eh, ew, t): t_1 = math.sqrt(math.pow((ew * math.sin(t)), 2.0)) tmp = 0 if t <= -4.5e+33: tmp = t_1 elif t <= -4.6e-130: tmp = ew * math.sqrt(math.pow(math.sin(t), 2.0)) elif t <= 5.1e-23: tmp = (t * ew) + (eh * math.sin(math.atan((eh / (ew * math.tan(t)))))) else: tmp = t_1 return tmp
function code(eh, ew, t) t_1 = sqrt((Float64(ew * sin(t)) ^ 2.0)) tmp = 0.0 if (t <= -4.5e+33) tmp = t_1; elseif (t <= -4.6e-130) tmp = Float64(ew * sqrt((sin(t) ^ 2.0))); elseif (t <= 5.1e-23) tmp = Float64(Float64(t * ew) + Float64(eh * sin(atan(Float64(eh / Float64(ew * tan(t))))))); else tmp = t_1; end return tmp end
function tmp_2 = code(eh, ew, t) t_1 = sqrt(((ew * sin(t)) ^ 2.0)); tmp = 0.0; if (t <= -4.5e+33) tmp = t_1; elseif (t <= -4.6e-130) tmp = ew * sqrt((sin(t) ^ 2.0)); elseif (t <= 5.1e-23) tmp = (t * ew) + (eh * sin(atan((eh / (ew * tan(t)))))); else tmp = t_1; end tmp_2 = tmp; end
code[eh_, ew_, t_] := Block[{t$95$1 = N[Sqrt[N[Power[N[(ew * N[Sin[t], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t, -4.5e+33], t$95$1, If[LessEqual[t, -4.6e-130], N[(ew * N[Sqrt[N[Power[N[Sin[t], $MachinePrecision], 2.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 5.1e-23], N[(N[(t * ew), $MachinePrecision] + N[(eh * N[Sin[N[ArcTan[N[(eh / N[(ew * N[Tan[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \sqrt{{\left(ew \cdot \sin t\right)}^{2}}\\
\mathbf{if}\;t \leq -4.5 \cdot 10^{+33}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq -4.6 \cdot 10^{-130}:\\
\;\;\;\;ew \cdot \sqrt{{\sin t}^{2}}\\
\mathbf{elif}\;t \leq 5.1 \cdot 10^{-23}:\\
\;\;\;\;t \cdot ew + eh \cdot \sin \tan^{-1} \left(\frac{eh}{ew \cdot \tan t}\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -4.5e33 or 5.10000000000000011e-23 < t Initial program 99.6%
fma-define99.6%
associate-/l/99.6%
associate-*l*99.7%
associate-/l/99.7%
Simplified99.7%
add-cube-cbrt97.8%
pow397.8%
Applied egg-rr49.2%
Taylor expanded in ew around inf 23.8%
add-sqr-sqrt22.9%
sqrt-unprod33.6%
pow233.6%
Applied egg-rr33.6%
if -4.5e33 < t < -4.6000000000000002e-130Initial program 100.0%
fma-define100.0%
associate-/l/100.0%
associate-*l*100.0%
associate-/l/100.0%
Simplified100.0%
add-cube-cbrt98.1%
pow398.0%
Applied egg-rr25.5%
Taylor expanded in ew around inf 11.1%
add-sqr-sqrt6.3%
sqrt-unprod39.7%
pow239.7%
Applied egg-rr39.7%
if -4.6000000000000002e-130 < t < 5.10000000000000011e-23Initial program 100.0%
fma-define100.0%
associate-/l/100.0%
associate-*l*100.0%
associate-/l/100.0%
Simplified100.0%
add-cube-cbrt97.7%
pow397.6%
Applied egg-rr54.2%
Taylor expanded in ew around inf 49.6%
*-commutative49.6%
associate-/r*49.6%
associate-*r/49.6%
associate-*l*49.6%
Simplified49.6%
Taylor expanded in t around 0 55.2%
Final simplification42.9%
(FPCore (eh ew t) :precision binary64 (if (<= ew 1.75e+214) (sqrt (pow (* ew (sin t)) 2.0)) (* ew (sqrt (pow (sin t) 2.0)))))
double code(double eh, double ew, double t) {
double tmp;
if (ew <= 1.75e+214) {
tmp = sqrt(pow((ew * sin(t)), 2.0));
} else {
tmp = ew * sqrt(pow(sin(t), 2.0));
}
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.75d+214) then
tmp = sqrt(((ew * sin(t)) ** 2.0d0))
else
tmp = ew * sqrt((sin(t) ** 2.0d0))
end if
code = tmp
end function
public static double code(double eh, double ew, double t) {
double tmp;
if (ew <= 1.75e+214) {
tmp = Math.sqrt(Math.pow((ew * Math.sin(t)), 2.0));
} else {
tmp = ew * Math.sqrt(Math.pow(Math.sin(t), 2.0));
}
return tmp;
}
def code(eh, ew, t): tmp = 0 if ew <= 1.75e+214: tmp = math.sqrt(math.pow((ew * math.sin(t)), 2.0)) else: tmp = ew * math.sqrt(math.pow(math.sin(t), 2.0)) return tmp
function code(eh, ew, t) tmp = 0.0 if (ew <= 1.75e+214) tmp = sqrt((Float64(ew * sin(t)) ^ 2.0)); else tmp = Float64(ew * sqrt((sin(t) ^ 2.0))); end return tmp end
function tmp_2 = code(eh, ew, t) tmp = 0.0; if (ew <= 1.75e+214) tmp = sqrt(((ew * sin(t)) ^ 2.0)); else tmp = ew * sqrt((sin(t) ^ 2.0)); end tmp_2 = tmp; end
code[eh_, ew_, t_] := If[LessEqual[ew, 1.75e+214], N[Sqrt[N[Power[N[(ew * N[Sin[t], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]], $MachinePrecision], N[(ew * N[Sqrt[N[Power[N[Sin[t], $MachinePrecision], 2.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;ew \leq 1.75 \cdot 10^{+214}:\\
\;\;\;\;\sqrt{{\left(ew \cdot \sin t\right)}^{2}}\\
\mathbf{else}:\\
\;\;\;\;ew \cdot \sqrt{{\sin t}^{2}}\\
\end{array}
\end{array}
if ew < 1.75e214Initial program 99.8%
fma-define99.8%
associate-/l/99.8%
associate-*l*99.8%
associate-/l/99.8%
Simplified99.8%
add-cube-cbrt97.8%
pow397.8%
Applied egg-rr47.5%
Taylor expanded in ew around inf 19.3%
add-sqr-sqrt18.4%
sqrt-unprod29.3%
pow229.3%
Applied egg-rr29.3%
if 1.75e214 < ew Initial program 99.9%
fma-define99.9%
associate-/l/99.9%
associate-*l*99.9%
associate-/l/99.9%
Simplified99.9%
add-cube-cbrt97.8%
pow397.7%
Applied egg-rr55.1%
Taylor expanded in ew around inf 48.6%
add-sqr-sqrt48.0%
sqrt-unprod76.9%
pow276.9%
Applied egg-rr76.9%
(FPCore (eh ew t) :precision binary64 (let* ((t_1 (* ew (sin t)))) (if (<= ew 3.4e+183) (sqrt (pow t_1 2.0)) t_1)))
double code(double eh, double ew, double t) {
double t_1 = ew * sin(t);
double tmp;
if (ew <= 3.4e+183) {
tmp = sqrt(pow(t_1, 2.0));
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(eh, ew, t)
real(8), intent (in) :: eh
real(8), intent (in) :: ew
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = ew * sin(t)
if (ew <= 3.4d+183) then
tmp = sqrt((t_1 ** 2.0d0))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double eh, double ew, double t) {
double t_1 = ew * Math.sin(t);
double tmp;
if (ew <= 3.4e+183) {
tmp = Math.sqrt(Math.pow(t_1, 2.0));
} else {
tmp = t_1;
}
return tmp;
}
def code(eh, ew, t): t_1 = ew * math.sin(t) tmp = 0 if ew <= 3.4e+183: tmp = math.sqrt(math.pow(t_1, 2.0)) else: tmp = t_1 return tmp
function code(eh, ew, t) t_1 = Float64(ew * sin(t)) tmp = 0.0 if (ew <= 3.4e+183) tmp = sqrt((t_1 ^ 2.0)); else tmp = t_1; end return tmp end
function tmp_2 = code(eh, ew, t) t_1 = ew * sin(t); tmp = 0.0; if (ew <= 3.4e+183) tmp = sqrt((t_1 ^ 2.0)); else tmp = t_1; end tmp_2 = tmp; end
code[eh_, ew_, t_] := Block[{t$95$1 = N[(ew * N[Sin[t], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[ew, 3.4e+183], N[Sqrt[N[Power[t$95$1, 2.0], $MachinePrecision]], $MachinePrecision], t$95$1]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := ew \cdot \sin t\\
\mathbf{if}\;ew \leq 3.4 \cdot 10^{+183}:\\
\;\;\;\;\sqrt{{t\_1}^{2}}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if ew < 3.4e183Initial program 99.8%
fma-define99.8%
associate-/l/99.8%
associate-*l*99.8%
associate-/l/99.8%
Simplified99.8%
add-cube-cbrt97.7%
pow397.7%
Applied egg-rr47.0%
Taylor expanded in ew around inf 18.4%
add-sqr-sqrt17.4%
sqrt-unprod28.9%
pow228.9%
Applied egg-rr28.9%
if 3.4e183 < ew Initial program 99.9%
fma-define99.9%
associate-/l/99.9%
associate-*l*99.9%
associate-/l/99.9%
Simplified99.9%
add-cube-cbrt97.9%
pow397.8%
Applied egg-rr57.7%
Taylor expanded in ew around inf 52.3%
(FPCore (eh ew t) :precision binary64 (* ew (sin t)))
double code(double eh, double ew, double t) {
return 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 = ew * sin(t)
end function
public static double code(double eh, double ew, double t) {
return ew * Math.sin(t);
}
def code(eh, ew, t): return ew * math.sin(t)
function code(eh, ew, t) return Float64(ew * sin(t)) end
function tmp = code(eh, ew, t) tmp = ew * sin(t); end
code[eh_, ew_, t_] := N[(ew * N[Sin[t], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
ew \cdot \sin t
\end{array}
Initial program 99.8%
fma-define99.8%
associate-/l/99.8%
associate-*l*99.8%
associate-/l/99.8%
Simplified99.8%
add-cube-cbrt97.8%
pow397.7%
Applied egg-rr48.2%
Taylor expanded in ew around inf 22.2%
(FPCore (eh ew t) :precision binary64 (* t ew))
double code(double eh, double ew, double t) {
return 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 = t * ew
end function
public static double code(double eh, double ew, double t) {
return t * ew;
}
def code(eh, ew, t): return t * ew
function code(eh, ew, t) return Float64(t * ew) end
function tmp = code(eh, ew, t) tmp = t * ew; end
code[eh_, ew_, t_] := N[(t * ew), $MachinePrecision]
\begin{array}{l}
\\
t \cdot ew
\end{array}
Initial program 99.8%
fma-define99.8%
associate-/l/99.8%
associate-*l*99.8%
associate-/l/99.8%
Simplified99.8%
add-cube-cbrt97.8%
pow397.7%
Applied egg-rr48.2%
Taylor expanded in ew around inf 22.2%
Taylor expanded in t around 0 12.1%
Final simplification12.1%
herbie shell --seed 2024139
(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))))))))