
(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 12 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.9%
fma-define99.9%
associate-/l/99.9%
associate-*l*99.9%
associate-/l/99.9%
Simplified99.9%
Taylor expanded in ew around 0 99.9%
(FPCore (eh ew t) :precision binary64 (fabs (+ (* ew (/ (sin t) (hypot 1.0 (/ eh (* ew (tan t)))))) (* (* eh (cos t)) (sin (atan (/ (/ eh ew) (tan t))))))))
double code(double eh, double ew, double t) {
return fabs(((ew * (sin(t) / hypot(1.0, (eh / (ew * tan(t)))))) + ((eh * cos(t)) * sin(atan(((eh / ew) / tan(t)))))));
}
public static double code(double eh, double ew, double t) {
return Math.abs(((ew * (Math.sin(t) / Math.hypot(1.0, (eh / (ew * Math.tan(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) / math.hypot(1.0, (eh / (ew * math.tan(t)))))) + ((eh * math.cos(t)) * math.sin(math.atan(((eh / ew) / math.tan(t)))))))
function code(eh, ew, t) return abs(Float64(Float64(ew * Float64(sin(t) / hypot(1.0, Float64(eh / Float64(ew * tan(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) / hypot(1.0, (eh / (ew * tan(t)))))) + ((eh * cos(t)) * sin(atan(((eh / ew) / tan(t))))))); end
code[eh_, ew_, t_] := N[Abs[N[(N[(ew * N[(N[Sin[t], $MachinePrecision] / N[Sqrt[1.0 ^ 2 + N[(eh / N[(ew * N[Tan[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] ^ 2], $MachinePrecision]), $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 \frac{\sin t}{\mathsf{hypot}\left(1, \frac{eh}{ew \cdot \tan t}\right)} + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right|
\end{array}
Initial program 99.9%
associate-/l/99.9%
cos-atan99.9%
un-div-inv99.9%
hypot-1-def99.9%
associate-/l/99.9%
Applied egg-rr99.9%
associate-*r/99.9%
associate-/r*99.9%
Simplified99.9%
(FPCore (eh ew t) :precision binary64 (fabs (+ (* (* eh (cos t)) (sin (atan (/ (/ eh ew) (tan t))))) (* ew (sin t)))))
double code(double eh, double ew, double t) {
return fabs((((eh * cos(t)) * sin(atan(((eh / ew) / tan(t))))) + (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((((eh * cos(t)) * sin(atan(((eh / ew) / tan(t))))) + (ew * sin(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))));
}
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))))
function code(eh, ew, t) return abs(Float64(Float64(Float64(eh * cos(t)) * sin(atan(Float64(Float64(eh / ew) / tan(t))))) + Float64(ew * sin(t)))) end
function tmp = code(eh, ew, t) tmp = abs((((eh * cos(t)) * sin(atan(((eh / ew) / tan(t))))) + (ew * 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[Sin[t], $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) + ew \cdot \sin t\right|
\end{array}
Initial program 99.9%
add-cbrt-cube90.6%
pow390.6%
Applied egg-rr90.6%
associate-/r*90.6%
cos-atan90.6%
un-div-inv90.6%
rem-cbrt-cube99.9%
hypot-1-def99.9%
associate-/r*99.9%
Applied egg-rr99.9%
associate-*r/99.9%
associate-/l/99.9%
associate-/r*99.9%
Simplified99.9%
Taylor expanded in ew around inf 99.2%
Final simplification99.2%
(FPCore (eh ew t) :precision binary64 (if (or (<= eh -9.5e+47) (not (<= eh 1.08e+58))) (fabs (* (sin (atan (/ eh (* ew (tan t))))) (* eh (cos t)))) (fabs (+ (* ew (sin t)) (* eh (sin (atan (/ (/ eh ew) (tan t)))))))))
double code(double eh, double ew, double t) {
double tmp;
if ((eh <= -9.5e+47) || !(eh <= 1.08e+58)) {
tmp = fabs((sin(atan((eh / (ew * tan(t))))) * (eh * cos(t))));
} else {
tmp = fabs(((ew * sin(t)) + (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 ((eh <= (-9.5d+47)) .or. (.not. (eh <= 1.08d+58))) then
tmp = abs((sin(atan((eh / (ew * tan(t))))) * (eh * cos(t))))
else
tmp = abs(((ew * sin(t)) + (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 ((eh <= -9.5e+47) || !(eh <= 1.08e+58)) {
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) / Math.tan(t)))))));
}
return tmp;
}
def code(eh, ew, t): tmp = 0 if (eh <= -9.5e+47) or not (eh <= 1.08e+58): 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) / math.tan(t))))))) return tmp
function code(eh, ew, t) tmp = 0.0 if ((eh <= -9.5e+47) || !(eh <= 1.08e+58)) tmp = abs(Float64(sin(atan(Float64(eh / Float64(ew * tan(t))))) * Float64(eh * cos(t)))); else tmp = abs(Float64(Float64(ew * sin(t)) + 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 ((eh <= -9.5e+47) || ~((eh <= 1.08e+58))) tmp = abs((sin(atan((eh / (ew * tan(t))))) * (eh * cos(t)))); else tmp = abs(((ew * sin(t)) + (eh * sin(atan(((eh / ew) / tan(t))))))); end tmp_2 = tmp; end
code[eh_, ew_, t_] := If[Or[LessEqual[eh, -9.5e+47], N[Not[LessEqual[eh, 1.08e+58]], $MachinePrecision]], N[Abs[N[(N[Sin[N[ArcTan[N[(eh / N[(ew * N[Tan[t], $MachinePrecision]), $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 / ew), $MachinePrecision] / N[Tan[t], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;eh \leq -9.5 \cdot 10^{+47} \lor \neg \left(eh \leq 1.08 \cdot 10^{+58}\right):\\
\;\;\;\;\left|\sin \tan^{-1} \left(\frac{eh}{ew \cdot \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{\frac{eh}{ew}}{\tan t}\right)\right|\\
\end{array}
\end{array}
if eh < -9.50000000000000001e47 or 1.0799999999999999e58 < eh Initial program 99.9%
fma-define99.9%
associate-/l/99.9%
associate-*l*99.9%
associate-/l/99.9%
Simplified99.9%
Taylor expanded in ew around 0 91.2%
associate-*r*91.2%
*-commutative91.2%
Simplified91.2%
if -9.50000000000000001e47 < eh < 1.0799999999999999e58Initial program 99.8%
add-cbrt-cube84.5%
pow384.5%
Applied egg-rr84.5%
associate-/r*84.5%
cos-atan84.5%
un-div-inv84.5%
rem-cbrt-cube99.8%
hypot-1-def99.8%
associate-/r*99.8%
Applied egg-rr99.8%
associate-*r/99.8%
associate-/l/99.8%
associate-/r*99.8%
Simplified99.8%
Taylor expanded in ew around inf 99.5%
Taylor expanded in t around 0 90.7%
*-commutative90.7%
*-commutative90.7%
associate-/r*90.7%
Simplified90.7%
Final simplification90.9%
(FPCore (eh ew t)
:precision binary64
(let* ((t_1 (* eh (cos t))))
(if (<= eh -1.4e+95)
(fabs
(*
t_1
(sin
(atan
(/ (/ (+ eh (* -0.3333333333333333 (* eh (pow t 2.0)))) t) ew)))))
(fabs (+ (* ew (sin t)) (* t_1 (sin (atan (/ eh (* t ew))))))))))
double code(double eh, double ew, double t) {
double t_1 = eh * cos(t);
double tmp;
if (eh <= -1.4e+95) {
tmp = fabs((t_1 * sin(atan((((eh + (-0.3333333333333333 * (eh * pow(t, 2.0)))) / t) / ew)))));
} else {
tmp = fabs(((ew * sin(t)) + (t_1 * sin(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) :: t_1
real(8) :: tmp
t_1 = eh * cos(t)
if (eh <= (-1.4d+95)) then
tmp = abs((t_1 * sin(atan((((eh + ((-0.3333333333333333d0) * (eh * (t ** 2.0d0)))) / t) / ew)))))
else
tmp = abs(((ew * sin(t)) + (t_1 * sin(atan((eh / (t * ew)))))))
end if
code = tmp
end function
public static double code(double eh, double ew, double t) {
double t_1 = eh * Math.cos(t);
double tmp;
if (eh <= -1.4e+95) {
tmp = Math.abs((t_1 * Math.sin(Math.atan((((eh + (-0.3333333333333333 * (eh * Math.pow(t, 2.0)))) / t) / ew)))));
} else {
tmp = Math.abs(((ew * Math.sin(t)) + (t_1 * Math.sin(Math.atan((eh / (t * ew)))))));
}
return tmp;
}
def code(eh, ew, t): t_1 = eh * math.cos(t) tmp = 0 if eh <= -1.4e+95: tmp = math.fabs((t_1 * math.sin(math.atan((((eh + (-0.3333333333333333 * (eh * math.pow(t, 2.0)))) / t) / ew))))) else: tmp = math.fabs(((ew * math.sin(t)) + (t_1 * math.sin(math.atan((eh / (t * ew))))))) return tmp
function code(eh, ew, t) t_1 = Float64(eh * cos(t)) tmp = 0.0 if (eh <= -1.4e+95) tmp = abs(Float64(t_1 * sin(atan(Float64(Float64(Float64(eh + Float64(-0.3333333333333333 * Float64(eh * (t ^ 2.0)))) / t) / ew))))); else tmp = abs(Float64(Float64(ew * sin(t)) + Float64(t_1 * sin(atan(Float64(eh / Float64(t * ew))))))); end return tmp end
function tmp_2 = code(eh, ew, t) t_1 = eh * cos(t); tmp = 0.0; if (eh <= -1.4e+95) tmp = abs((t_1 * sin(atan((((eh + (-0.3333333333333333 * (eh * (t ^ 2.0)))) / t) / ew))))); else tmp = abs(((ew * sin(t)) + (t_1 * sin(atan((eh / (t * ew))))))); end tmp_2 = tmp; end
code[eh_, ew_, t_] := Block[{t$95$1 = N[(eh * N[Cos[t], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[eh, -1.4e+95], N[Abs[N[(t$95$1 * N[Sin[N[ArcTan[N[(N[(N[(eh + N[(-0.3333333333333333 * N[(eh * N[Power[t, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision] / ew), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Abs[N[(N[(ew * N[Sin[t], $MachinePrecision]), $MachinePrecision] + N[(t$95$1 * N[Sin[N[ArcTan[N[(eh / N[(t * ew), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := eh \cdot \cos t\\
\mathbf{if}\;eh \leq -1.4 \cdot 10^{+95}:\\
\;\;\;\;\left|t\_1 \cdot \sin \tan^{-1} \left(\frac{\frac{eh + -0.3333333333333333 \cdot \left(eh \cdot {t}^{2}\right)}{t}}{ew}\right)\right|\\
\mathbf{else}:\\
\;\;\;\;\left|ew \cdot \sin t + t\_1 \cdot \sin \tan^{-1} \left(\frac{eh}{t \cdot ew}\right)\right|\\
\end{array}
\end{array}
if eh < -1.3999999999999999e95Initial program 99.9%
fma-define99.9%
associate-/l/99.9%
associate-*l*99.9%
associate-/l/99.9%
Simplified99.9%
Taylor expanded in ew around inf 71.3%
fma-define71.3%
associate-/l*71.2%
Simplified71.2%
Taylor expanded in ew around 0 93.4%
associate-*r*93.4%
*-commutative93.4%
associate-/r*93.4%
Simplified93.4%
Taylor expanded in t around 0 93.5%
if -1.3999999999999999e95 < eh Initial program 99.9%
add-cbrt-cube88.2%
pow388.2%
Applied egg-rr88.2%
associate-/r*88.2%
cos-atan88.2%
un-div-inv88.2%
rem-cbrt-cube99.9%
hypot-1-def99.9%
associate-/r*99.9%
Applied egg-rr99.9%
associate-*r/99.9%
associate-/l/99.9%
associate-/r*99.9%
Simplified99.9%
Taylor expanded in ew around inf 99.4%
Taylor expanded in t around 0 92.1%
Final simplification92.3%
(FPCore (eh ew t) :precision binary64 (if (or (<= eh -6.3e-65) (not (<= eh 1.9e-6))) (fabs (* (sin (atan (/ eh (* ew (tan t))))) (* eh (cos t)))) (fabs (* ew (* (sin t) (cos (atan (/ (/ eh (tan t)) ew))))))))
double code(double eh, double ew, double t) {
double tmp;
if ((eh <= -6.3e-65) || !(eh <= 1.9e-6)) {
tmp = fabs((sin(atan((eh / (ew * tan(t))))) * (eh * cos(t))));
} else {
tmp = fabs((ew * (sin(t) * cos(atan(((eh / tan(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 <= (-6.3d-65)) .or. (.not. (eh <= 1.9d-6))) then
tmp = abs((sin(atan((eh / (ew * tan(t))))) * (eh * cos(t))))
else
tmp = abs((ew * (sin(t) * cos(atan(((eh / tan(t)) / ew))))))
end if
code = tmp
end function
public static double code(double eh, double ew, double t) {
double tmp;
if ((eh <= -6.3e-65) || !(eh <= 1.9e-6)) {
tmp = Math.abs((Math.sin(Math.atan((eh / (ew * Math.tan(t))))) * (eh * Math.cos(t))));
} else {
tmp = Math.abs((ew * (Math.sin(t) * Math.cos(Math.atan(((eh / Math.tan(t)) / ew))))));
}
return tmp;
}
def code(eh, ew, t): tmp = 0 if (eh <= -6.3e-65) or not (eh <= 1.9e-6): tmp = math.fabs((math.sin(math.atan((eh / (ew * math.tan(t))))) * (eh * math.cos(t)))) else: tmp = math.fabs((ew * (math.sin(t) * math.cos(math.atan(((eh / math.tan(t)) / ew)))))) return tmp
function code(eh, ew, t) tmp = 0.0 if ((eh <= -6.3e-65) || !(eh <= 1.9e-6)) tmp = abs(Float64(sin(atan(Float64(eh / Float64(ew * tan(t))))) * Float64(eh * cos(t)))); else tmp = abs(Float64(ew * Float64(sin(t) * cos(atan(Float64(Float64(eh / tan(t)) / ew)))))); end return tmp end
function tmp_2 = code(eh, ew, t) tmp = 0.0; if ((eh <= -6.3e-65) || ~((eh <= 1.9e-6))) tmp = abs((sin(atan((eh / (ew * tan(t))))) * (eh * cos(t)))); else tmp = abs((ew * (sin(t) * cos(atan(((eh / tan(t)) / ew)))))); end tmp_2 = tmp; end
code[eh_, ew_, t_] := If[Or[LessEqual[eh, -6.3e-65], N[Not[LessEqual[eh, 1.9e-6]], $MachinePrecision]], N[Abs[N[(N[Sin[N[ArcTan[N[(eh / N[(ew * N[Tan[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * N[(eh * N[Cos[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Abs[N[(ew * N[(N[Sin[t], $MachinePrecision] * N[Cos[N[ArcTan[N[(N[(eh / N[Tan[t], $MachinePrecision]), $MachinePrecision] / ew), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;eh \leq -6.3 \cdot 10^{-65} \lor \neg \left(eh \leq 1.9 \cdot 10^{-6}\right):\\
\;\;\;\;\left|\sin \tan^{-1} \left(\frac{eh}{ew \cdot \tan t}\right) \cdot \left(eh \cdot \cos t\right)\right|\\
\mathbf{else}:\\
\;\;\;\;\left|ew \cdot \left(\sin t \cdot \cos \tan^{-1} \left(\frac{\frac{eh}{\tan t}}{ew}\right)\right)\right|\\
\end{array}
\end{array}
if eh < -6.2999999999999997e-65 or 1.9e-6 < eh Initial program 99.9%
fma-define99.9%
associate-/l/99.9%
associate-*l*99.9%
associate-/l/99.9%
Simplified99.9%
Taylor expanded in ew around 0 86.1%
associate-*r*86.1%
*-commutative86.1%
Simplified86.1%
if -6.2999999999999997e-65 < eh < 1.9e-6Initial 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%
fma-define99.8%
associate-/l*99.7%
Simplified99.7%
Taylor expanded in ew around inf 72.1%
*-commutative72.1%
*-commutative72.1%
associate-/r*72.1%
Simplified72.1%
Final simplification80.2%
(FPCore (eh ew t) :precision binary64 (if (or (<= eh -2.9e-64) (not (<= eh 0.13))) (fabs (* (* eh (cos t)) (sin (atan (/ (/ eh t) ew))))) (fabs (* ew (* (sin t) (cos (atan (/ (/ eh (tan t)) ew))))))))
double code(double eh, double ew, double t) {
double tmp;
if ((eh <= -2.9e-64) || !(eh <= 0.13)) {
tmp = fabs(((eh * cos(t)) * sin(atan(((eh / t) / ew)))));
} else {
tmp = fabs((ew * (sin(t) * cos(atan(((eh / tan(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 <= (-2.9d-64)) .or. (.not. (eh <= 0.13d0))) then
tmp = abs(((eh * cos(t)) * sin(atan(((eh / t) / ew)))))
else
tmp = abs((ew * (sin(t) * cos(atan(((eh / tan(t)) / ew))))))
end if
code = tmp
end function
public static double code(double eh, double ew, double t) {
double tmp;
if ((eh <= -2.9e-64) || !(eh <= 0.13)) {
tmp = Math.abs(((eh * Math.cos(t)) * Math.sin(Math.atan(((eh / t) / ew)))));
} else {
tmp = Math.abs((ew * (Math.sin(t) * Math.cos(Math.atan(((eh / Math.tan(t)) / ew))))));
}
return tmp;
}
def code(eh, ew, t): tmp = 0 if (eh <= -2.9e-64) or not (eh <= 0.13): tmp = math.fabs(((eh * math.cos(t)) * math.sin(math.atan(((eh / t) / ew))))) else: tmp = math.fabs((ew * (math.sin(t) * math.cos(math.atan(((eh / math.tan(t)) / ew)))))) return tmp
function code(eh, ew, t) tmp = 0.0 if ((eh <= -2.9e-64) || !(eh <= 0.13)) tmp = abs(Float64(Float64(eh * cos(t)) * sin(atan(Float64(Float64(eh / t) / ew))))); else tmp = abs(Float64(ew * Float64(sin(t) * cos(atan(Float64(Float64(eh / tan(t)) / ew)))))); end return tmp end
function tmp_2 = code(eh, ew, t) tmp = 0.0; if ((eh <= -2.9e-64) || ~((eh <= 0.13))) tmp = abs(((eh * cos(t)) * sin(atan(((eh / t) / ew))))); else tmp = abs((ew * (sin(t) * cos(atan(((eh / tan(t)) / ew)))))); end tmp_2 = tmp; end
code[eh_, ew_, t_] := If[Or[LessEqual[eh, -2.9e-64], N[Not[LessEqual[eh, 0.13]], $MachinePrecision]], N[Abs[N[(N[(eh * N[Cos[t], $MachinePrecision]), $MachinePrecision] * N[Sin[N[ArcTan[N[(N[(eh / t), $MachinePrecision] / ew), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Abs[N[(ew * N[(N[Sin[t], $MachinePrecision] * N[Cos[N[ArcTan[N[(N[(eh / N[Tan[t], $MachinePrecision]), $MachinePrecision] / ew), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;eh \leq -2.9 \cdot 10^{-64} \lor \neg \left(eh \leq 0.13\right):\\
\;\;\;\;\left|\left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{t}}{ew}\right)\right|\\
\mathbf{else}:\\
\;\;\;\;\left|ew \cdot \left(\sin t \cdot \cos \tan^{-1} \left(\frac{\frac{eh}{\tan t}}{ew}\right)\right)\right|\\
\end{array}
\end{array}
if eh < -2.8999999999999999e-64 or 0.13 < eh Initial program 99.9%
fma-define99.9%
associate-/l/99.9%
associate-*l*99.9%
associate-/l/99.9%
Simplified99.9%
Taylor expanded in ew around inf 73.4%
fma-define73.4%
associate-/l*73.2%
Simplified73.2%
Taylor expanded in ew around 0 86.1%
associate-*r*86.1%
*-commutative86.1%
associate-/r*86.1%
Simplified86.1%
Taylor expanded in t around 0 73.3%
if -2.8999999999999999e-64 < eh < 0.13Initial 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%
fma-define99.8%
associate-/l*99.7%
Simplified99.7%
Taylor expanded in ew around inf 72.1%
*-commutative72.1%
*-commutative72.1%
associate-/r*72.1%
Simplified72.1%
Final simplification72.8%
(FPCore (eh ew t)
:precision binary64
(let* ((t_1 (* eh (cos t))))
(if (<= eh -1.4e+95)
(fabs (* (sin (atan (/ eh (* ew (tan t))))) t_1))
(fabs (+ (* ew (sin t)) (* t_1 (sin (atan (/ eh (* t ew))))))))))
double code(double eh, double ew, double t) {
double t_1 = eh * cos(t);
double tmp;
if (eh <= -1.4e+95) {
tmp = fabs((sin(atan((eh / (ew * tan(t))))) * t_1));
} else {
tmp = fabs(((ew * sin(t)) + (t_1 * sin(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) :: t_1
real(8) :: tmp
t_1 = eh * cos(t)
if (eh <= (-1.4d+95)) then
tmp = abs((sin(atan((eh / (ew * tan(t))))) * t_1))
else
tmp = abs(((ew * sin(t)) + (t_1 * sin(atan((eh / (t * ew)))))))
end if
code = tmp
end function
public static double code(double eh, double ew, double t) {
double t_1 = eh * Math.cos(t);
double tmp;
if (eh <= -1.4e+95) {
tmp = Math.abs((Math.sin(Math.atan((eh / (ew * Math.tan(t))))) * t_1));
} else {
tmp = Math.abs(((ew * Math.sin(t)) + (t_1 * Math.sin(Math.atan((eh / (t * ew)))))));
}
return tmp;
}
def code(eh, ew, t): t_1 = eh * math.cos(t) tmp = 0 if eh <= -1.4e+95: tmp = math.fabs((math.sin(math.atan((eh / (ew * math.tan(t))))) * t_1)) else: tmp = math.fabs(((ew * math.sin(t)) + (t_1 * math.sin(math.atan((eh / (t * ew))))))) return tmp
function code(eh, ew, t) t_1 = Float64(eh * cos(t)) tmp = 0.0 if (eh <= -1.4e+95) tmp = abs(Float64(sin(atan(Float64(eh / Float64(ew * tan(t))))) * t_1)); else tmp = abs(Float64(Float64(ew * sin(t)) + Float64(t_1 * sin(atan(Float64(eh / Float64(t * ew))))))); end return tmp end
function tmp_2 = code(eh, ew, t) t_1 = eh * cos(t); tmp = 0.0; if (eh <= -1.4e+95) tmp = abs((sin(atan((eh / (ew * tan(t))))) * t_1)); else tmp = abs(((ew * sin(t)) + (t_1 * sin(atan((eh / (t * ew))))))); end tmp_2 = tmp; end
code[eh_, ew_, t_] := Block[{t$95$1 = N[(eh * N[Cos[t], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[eh, -1.4e+95], N[Abs[N[(N[Sin[N[ArcTan[N[(eh / N[(ew * N[Tan[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * t$95$1), $MachinePrecision]], $MachinePrecision], N[Abs[N[(N[(ew * N[Sin[t], $MachinePrecision]), $MachinePrecision] + N[(t$95$1 * N[Sin[N[ArcTan[N[(eh / N[(t * ew), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := eh \cdot \cos t\\
\mathbf{if}\;eh \leq -1.4 \cdot 10^{+95}:\\
\;\;\;\;\left|\sin \tan^{-1} \left(\frac{eh}{ew \cdot \tan t}\right) \cdot t\_1\right|\\
\mathbf{else}:\\
\;\;\;\;\left|ew \cdot \sin t + t\_1 \cdot \sin \tan^{-1} \left(\frac{eh}{t \cdot ew}\right)\right|\\
\end{array}
\end{array}
if eh < -1.3999999999999999e95Initial program 99.9%
fma-define99.9%
associate-/l/99.9%
associate-*l*99.9%
associate-/l/99.9%
Simplified99.9%
Taylor expanded in ew around 0 93.4%
associate-*r*93.4%
*-commutative93.4%
Simplified93.4%
if -1.3999999999999999e95 < eh Initial program 99.9%
add-cbrt-cube88.2%
pow388.2%
Applied egg-rr88.2%
associate-/r*88.2%
cos-atan88.2%
un-div-inv88.2%
rem-cbrt-cube99.9%
hypot-1-def99.9%
associate-/r*99.9%
Applied egg-rr99.9%
associate-*r/99.9%
associate-/l/99.9%
associate-/r*99.9%
Simplified99.9%
Taylor expanded in ew around inf 99.4%
Taylor expanded in t around 0 92.1%
Final simplification92.3%
(FPCore (eh ew t)
:precision binary64
(let* ((t_1 (* eh (cos t))))
(if (<= t -3.9e+155)
(* (sin (atan (/ eh (* ew (tan t))))) t_1)
(fabs (* t_1 (sin (atan (/ (/ eh t) ew))))))))
double code(double eh, double ew, double t) {
double t_1 = eh * cos(t);
double tmp;
if (t <= -3.9e+155) {
tmp = sin(atan((eh / (ew * tan(t))))) * t_1;
} else {
tmp = fabs((t_1 * sin(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) :: t_1
real(8) :: tmp
t_1 = eh * cos(t)
if (t <= (-3.9d+155)) then
tmp = sin(atan((eh / (ew * tan(t))))) * t_1
else
tmp = abs((t_1 * sin(atan(((eh / t) / ew)))))
end if
code = tmp
end function
public static double code(double eh, double ew, double t) {
double t_1 = eh * Math.cos(t);
double tmp;
if (t <= -3.9e+155) {
tmp = Math.sin(Math.atan((eh / (ew * Math.tan(t))))) * t_1;
} else {
tmp = Math.abs((t_1 * Math.sin(Math.atan(((eh / t) / ew)))));
}
return tmp;
}
def code(eh, ew, t): t_1 = eh * math.cos(t) tmp = 0 if t <= -3.9e+155: tmp = math.sin(math.atan((eh / (ew * math.tan(t))))) * t_1 else: tmp = math.fabs((t_1 * math.sin(math.atan(((eh / t) / ew))))) return tmp
function code(eh, ew, t) t_1 = Float64(eh * cos(t)) tmp = 0.0 if (t <= -3.9e+155) tmp = Float64(sin(atan(Float64(eh / Float64(ew * tan(t))))) * t_1); else tmp = abs(Float64(t_1 * sin(atan(Float64(Float64(eh / t) / ew))))); end return tmp end
function tmp_2 = code(eh, ew, t) t_1 = eh * cos(t); tmp = 0.0; if (t <= -3.9e+155) tmp = sin(atan((eh / (ew * tan(t))))) * t_1; else tmp = abs((t_1 * sin(atan(((eh / t) / ew))))); end tmp_2 = tmp; end
code[eh_, ew_, t_] := Block[{t$95$1 = N[(eh * N[Cos[t], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -3.9e+155], N[(N[Sin[N[ArcTan[N[(eh / N[(ew * N[Tan[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * t$95$1), $MachinePrecision], N[Abs[N[(t$95$1 * N[Sin[N[ArcTan[N[(N[(eh / t), $MachinePrecision] / ew), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := eh \cdot \cos t\\
\mathbf{if}\;t \leq -3.9 \cdot 10^{+155}:\\
\;\;\;\;\sin \tan^{-1} \left(\frac{eh}{ew \cdot \tan t}\right) \cdot t\_1\\
\mathbf{else}:\\
\;\;\;\;\left|t\_1 \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{t}}{ew}\right)\right|\\
\end{array}
\end{array}
if t < -3.8999999999999998e155Initial program 99.6%
fma-define99.6%
associate-/l/99.6%
associate-*l*99.6%
associate-/l/99.6%
Simplified99.6%
Taylor expanded in ew around inf 93.1%
fma-define93.1%
associate-/l*92.9%
Simplified92.9%
Taylor expanded in ew around 0 46.7%
associate-*r*46.7%
*-commutative46.7%
associate-/r*46.7%
Simplified46.7%
add-cbrt-cube17.3%
pow317.3%
Applied egg-rr17.3%
rem-cbrt-cube46.7%
add-sqr-sqrt28.5%
fabs-sqr28.5%
add-sqr-sqrt29.3%
associate-/l/29.3%
Applied egg-rr29.3%
if -3.8999999999999998e155 < t Initial program 99.9%
fma-define99.9%
associate-/l/99.9%
associate-*l*99.9%
associate-/l/99.9%
Simplified99.9%
Taylor expanded in ew around inf 83.4%
fma-define83.4%
associate-/l*83.3%
Simplified83.3%
Taylor expanded in ew around 0 65.5%
associate-*r*65.5%
*-commutative65.5%
associate-/r*65.5%
Simplified65.5%
Taylor expanded in t around 0 57.8%
Final simplification54.6%
(FPCore (eh ew t) :precision binary64 (fabs (* (* eh (cos t)) (sin (atan (/ (/ eh t) ew))))))
double code(double eh, double ew, double t) {
return fabs(((eh * cos(t)) * sin(atan(((eh / t) / ew)))));
}
real(8) function code(eh, ew, t)
real(8), intent (in) :: eh
real(8), intent (in) :: ew
real(8), intent (in) :: t
code = abs(((eh * cos(t)) * sin(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 / t) / ew)))));
}
def code(eh, ew, t): return math.fabs(((eh * math.cos(t)) * math.sin(math.atan(((eh / t) / ew)))))
function code(eh, ew, t) return abs(Float64(Float64(eh * cos(t)) * sin(atan(Float64(Float64(eh / t) / ew))))) end
function tmp = code(eh, ew, t) tmp = abs(((eh * cos(t)) * sin(atan(((eh / t) / ew))))); end
code[eh_, ew_, t_] := N[Abs[N[(N[(eh * N[Cos[t], $MachinePrecision]), $MachinePrecision] * N[Sin[N[ArcTan[N[(N[(eh / t), $MachinePrecision] / ew), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\left|\left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{t}}{ew}\right)\right|
\end{array}
Initial program 99.9%
fma-define99.9%
associate-/l/99.9%
associate-*l*99.9%
associate-/l/99.9%
Simplified99.9%
Taylor expanded in ew around inf 84.5%
fma-define84.5%
associate-/l*84.4%
Simplified84.4%
Taylor expanded in ew around 0 63.3%
associate-*r*63.3%
*-commutative63.3%
associate-/r*63.3%
Simplified63.3%
Taylor expanded in t around 0 52.6%
(FPCore (eh ew t) :precision binary64 (if (or (<= t -2e-6) (not (<= t 2.5e+36))) (* (* eh (cos t)) (sin (atan (/ eh (* t ew))))) (fabs eh)))
double code(double eh, double ew, double t) {
double tmp;
if ((t <= -2e-6) || !(t <= 2.5e+36)) {
tmp = (eh * cos(t)) * sin(atan((eh / (t * ew))));
} else {
tmp = fabs(eh);
}
return tmp;
}
real(8) function code(eh, ew, t)
real(8), intent (in) :: eh
real(8), intent (in) :: ew
real(8), intent (in) :: t
real(8) :: tmp
if ((t <= (-2d-6)) .or. (.not. (t <= 2.5d+36))) then
tmp = (eh * cos(t)) * sin(atan((eh / (t * ew))))
else
tmp = abs(eh)
end if
code = tmp
end function
public static double code(double eh, double ew, double t) {
double tmp;
if ((t <= -2e-6) || !(t <= 2.5e+36)) {
tmp = (eh * Math.cos(t)) * Math.sin(Math.atan((eh / (t * ew))));
} else {
tmp = Math.abs(eh);
}
return tmp;
}
def code(eh, ew, t): tmp = 0 if (t <= -2e-6) or not (t <= 2.5e+36): tmp = (eh * math.cos(t)) * math.sin(math.atan((eh / (t * ew)))) else: tmp = math.fabs(eh) return tmp
function code(eh, ew, t) tmp = 0.0 if ((t <= -2e-6) || !(t <= 2.5e+36)) tmp = Float64(Float64(eh * cos(t)) * sin(atan(Float64(eh / Float64(t * ew))))); else tmp = abs(eh); end return tmp end
function tmp_2 = code(eh, ew, t) tmp = 0.0; if ((t <= -2e-6) || ~((t <= 2.5e+36))) tmp = (eh * cos(t)) * sin(atan((eh / (t * ew)))); else tmp = abs(eh); end tmp_2 = tmp; end
code[eh_, ew_, t_] := If[Or[LessEqual[t, -2e-6], N[Not[LessEqual[t, 2.5e+36]], $MachinePrecision]], N[(N[(eh * N[Cos[t], $MachinePrecision]), $MachinePrecision] * N[Sin[N[ArcTan[N[(eh / N[(t * ew), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[Abs[eh], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2 \cdot 10^{-6} \lor \neg \left(t \leq 2.5 \cdot 10^{+36}\right):\\
\;\;\;\;\left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{eh}{t \cdot ew}\right)\\
\mathbf{else}:\\
\;\;\;\;\left|eh\right|\\
\end{array}
\end{array}
if t < -1.99999999999999991e-6 or 2.49999999999999988e36 < 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 84.3%
fma-define84.3%
associate-/l*84.2%
Simplified84.2%
Taylor expanded in ew around 0 57.9%
associate-*r*57.9%
*-commutative57.9%
associate-/r*57.9%
Simplified57.9%
Taylor expanded in t around 0 35.4%
add-sqr-sqrt26.0%
fabs-sqr26.0%
add-sqr-sqrt26.6%
associate-/l/26.5%
*-commutative26.5%
Applied egg-rr26.5%
if -1.99999999999999991e-6 < t < 2.49999999999999988e36Initial program 100.0%
fma-define100.0%
associate-/l/100.0%
associate-*l*100.0%
associate-/l/100.0%
Simplified100.0%
Taylor expanded in t around 0 66.9%
Taylor expanded in t around 0 66.9%
sin-atan16.0%
hypot-1-def31.2%
Applied egg-rr31.2%
associate-/l/31.4%
Simplified31.4%
Taylor expanded in eh around inf 67.3%
Final simplification48.0%
(FPCore (eh ew t) :precision binary64 (fabs eh))
double code(double eh, double ew, double t) {
return fabs(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)
end function
public static double code(double eh, double ew, double t) {
return Math.abs(eh);
}
def code(eh, ew, t): return math.fabs(eh)
function code(eh, ew, t) return abs(eh) end
function tmp = code(eh, ew, t) tmp = abs(eh); end
code[eh_, ew_, t_] := N[Abs[eh], $MachinePrecision]
\begin{array}{l}
\\
\left|eh\right|
\end{array}
Initial program 99.9%
fma-define99.9%
associate-/l/99.9%
associate-*l*99.9%
associate-/l/99.9%
Simplified99.9%
Taylor expanded in t around 0 42.0%
Taylor expanded in t around 0 40.2%
sin-atan11.5%
hypot-1-def20.7%
Applied egg-rr20.7%
associate-/l/20.9%
Simplified20.9%
Taylor expanded in eh around inf 42.5%
herbie shell --seed 2024181
(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))))))))