
(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 (fabs (+ (* (* ew (sin t)) (pow (+ 1.0 (pow (* ew (/ (tan t) eh)) -2.0)) -0.5)) (* (* eh (cos t)) (sin (atan (/ (/ eh ew) (tan t))))))))
double code(double eh, double ew, double t) {
return fabs((((ew * sin(t)) * pow((1.0 + pow((ew * (tan(t) / eh)), -2.0)), -0.5)) + ((eh * cos(t)) * sin(atan(((eh / ew) / tan(t)))))));
}
real(8) function code(eh, ew, t)
real(8), intent (in) :: eh
real(8), intent (in) :: ew
real(8), intent (in) :: t
code = abs((((ew * sin(t)) * ((1.0d0 + ((ew * (tan(t) / eh)) ** (-2.0d0))) ** (-0.5d0))) + ((eh * cos(t)) * sin(atan(((eh / ew) / tan(t)))))))
end function
public static double code(double eh, double ew, double t) {
return Math.abs((((ew * Math.sin(t)) * Math.pow((1.0 + Math.pow((ew * (Math.tan(t) / eh)), -2.0)), -0.5)) + ((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.pow((1.0 + math.pow((ew * (math.tan(t) / eh)), -2.0)), -0.5)) + ((eh * math.cos(t)) * math.sin(math.atan(((eh / ew) / math.tan(t)))))))
function code(eh, ew, t) return abs(Float64(Float64(Float64(ew * sin(t)) * (Float64(1.0 + (Float64(ew * Float64(tan(t) / eh)) ^ -2.0)) ^ -0.5)) + 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)) * ((1.0 + ((ew * (tan(t) / eh)) ^ -2.0)) ^ -0.5)) + ((eh * cos(t)) * sin(atan(((eh / ew) / tan(t))))))); end
code[eh_, ew_, t_] := N[Abs[N[(N[(N[(ew * N[Sin[t], $MachinePrecision]), $MachinePrecision] * N[Power[N[(1.0 + N[Power[N[(ew * N[(N[Tan[t], $MachinePrecision] / eh), $MachinePrecision]), $MachinePrecision], -2.0], $MachinePrecision]), $MachinePrecision], -0.5], $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|\left(ew \cdot \sin t\right) \cdot {\left(1 + {\left(ew \cdot \frac{\tan t}{eh}\right)}^{-2}\right)}^{-0.5} + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right|
\end{array}
Initial program 99.8%
cos-atanN/A
inv-powN/A
pow1/2N/A
pow-powN/A
pow-lowering-pow.f64N/A
Applied egg-rr99.8%
(FPCore (eh ew t) :precision binary64 (let* ((t_1 (atan (/ eh (* ew (tan t)))))) (fabs (+ (* (sin t) (* ew (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(((sin(t) * (ew * 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(((sin(t) * (ew * 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(((Math.sin(t) * (ew * 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(((math.sin(t) * (ew * math.cos(t_1))) + (eh * (math.cos(t) * math.sin(t_1)))))
function code(eh, ew, t) t_1 = atan(Float64(eh / Float64(ew * tan(t)))) return abs(Float64(Float64(sin(t) * Float64(ew * cos(t_1))) + Float64(eh * Float64(cos(t) * sin(t_1))))) end
function tmp = code(eh, ew, t) t_1 = atan((eh / (ew * tan(t)))); tmp = abs(((sin(t) * (ew * cos(t_1))) + (eh * (cos(t) * sin(t_1))))); 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[(N[Sin[t], $MachinePrecision] * N[(ew * N[Cos[t$95$1], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(eh * N[(N[Cos[t], $MachinePrecision] * N[Sin[t$95$1], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \tan^{-1} \left(\frac{eh}{ew \cdot \tan t}\right)\\
\left|\sin t \cdot \left(ew \cdot \cos t\_1\right) + eh \cdot \left(\cos t \cdot \sin t\_1\right)\right|
\end{array}
\end{array}
Initial program 99.8%
cos-atanN/A
inv-powN/A
pow1/2N/A
pow-powN/A
pow-lowering-pow.f64N/A
Applied egg-rr99.8%
Applied egg-rr99.8%
(FPCore (eh ew t) :precision binary64 (fabs (+ (* (* eh (cos t)) (sin (atan (/ (/ eh ew) (tan t))))) (* (* ew (sin t)) (cos (atan (/ eh (* ew t))))))))
double code(double eh, double ew, double t) {
return fabs((((eh * cos(t)) * sin(atan(((eh / ew) / tan(t))))) + ((ew * sin(t)) * cos(atan((eh / (ew * t)))))));
}
real(8) function code(eh, ew, t)
real(8), intent (in) :: eh
real(8), intent (in) :: ew
real(8), intent (in) :: t
code = abs((((eh * cos(t)) * sin(atan(((eh / ew) / tan(t))))) + ((ew * sin(t)) * cos(atan((eh / (ew * t)))))))
end function
public static double code(double eh, double ew, double t) {
return Math.abs((((eh * Math.cos(t)) * Math.sin(Math.atan(((eh / ew) / Math.tan(t))))) + ((ew * Math.sin(t)) * Math.cos(Math.atan((eh / (ew * t)))))));
}
def code(eh, ew, t): return math.fabs((((eh * math.cos(t)) * math.sin(math.atan(((eh / ew) / math.tan(t))))) + ((ew * math.sin(t)) * math.cos(math.atan((eh / (ew * t)))))))
function code(eh, ew, t) return abs(Float64(Float64(Float64(eh * cos(t)) * sin(atan(Float64(Float64(eh / ew) / tan(t))))) + Float64(Float64(ew * sin(t)) * cos(atan(Float64(eh / Float64(ew * t))))))) end
function tmp = code(eh, ew, t) tmp = abs((((eh * cos(t)) * sin(atan(((eh / ew) / tan(t))))) + ((ew * sin(t)) * cos(atan((eh / (ew * t))))))); end
code[eh_, ew_, t_] := N[Abs[N[(N[(N[(eh * N[Cos[t], $MachinePrecision]), $MachinePrecision] * N[Sin[N[ArcTan[N[(N[(eh / ew), $MachinePrecision] / N[Tan[t], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + N[(N[(ew * N[Sin[t], $MachinePrecision]), $MachinePrecision] * N[Cos[N[ArcTan[N[(eh / N[(ew * t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\left|\left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right) + \left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{eh}{ew \cdot t}\right)\right|
\end{array}
Initial program 99.8%
Taylor expanded in t around 0
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f6498.6
Simplified98.6%
Final simplification98.6%
(FPCore (eh ew t) :precision binary64 (fabs (+ (* ew (sin t)) (* (* eh (cos t)) (sin (atan (/ eh (* ew (tan t)))))))))
double code(double eh, double ew, double t) {
return fabs(((ew * sin(t)) + ((eh * cos(t)) * sin(atan((eh / (ew * tan(t))))))));
}
real(8) function code(eh, ew, t)
real(8), intent (in) :: eh
real(8), intent (in) :: ew
real(8), intent (in) :: t
code = abs(((ew * sin(t)) + ((eh * cos(t)) * sin(atan((eh / (ew * tan(t))))))))
end function
public static double code(double eh, double ew, double t) {
return Math.abs(((ew * Math.sin(t)) + ((eh * Math.cos(t)) * Math.sin(Math.atan((eh / (ew * Math.tan(t))))))));
}
def code(eh, ew, t): return math.fabs(((ew * math.sin(t)) + ((eh * math.cos(t)) * math.sin(math.atan((eh / (ew * math.tan(t))))))))
function code(eh, ew, t) return abs(Float64(Float64(ew * sin(t)) + Float64(Float64(eh * cos(t)) * sin(atan(Float64(eh / Float64(ew * tan(t)))))))) end
function tmp = code(eh, ew, t) tmp = abs(((ew * sin(t)) + ((eh * cos(t)) * sin(atan((eh / (ew * tan(t)))))))); end
code[eh_, ew_, t_] := N[Abs[N[(N[(ew * N[Sin[t], $MachinePrecision]), $MachinePrecision] + N[(N[(eh * N[Cos[t], $MachinePrecision]), $MachinePrecision] * N[Sin[N[ArcTan[N[(eh / N[(ew * N[Tan[t], $MachinePrecision]), $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 \tan t}\right)\right|
\end{array}
Initial program 99.8%
cos-atanN/A
inv-powN/A
pow1/2N/A
pow-powN/A
pow-lowering-pow.f64N/A
Applied egg-rr99.8%
Taylor expanded in eh around 0
+-lowering-+.f64N/A
associate-*r*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
cos-lowering-cos.f64N/A
sin-lowering-sin.f64N/A
atan-lowering-atan.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
tan-lowering-tan.f64N/A
*-lowering-*.f64N/A
sin-lowering-sin.f6498.4
Simplified98.4%
Final simplification98.4%
(FPCore (eh ew t)
:precision binary64
(let* ((t_1 (fabs (* ew (sin t)))))
(if (<= ew -6e+72)
t_1
(if (<= ew 6e+69)
(fabs (* (* eh (cos t)) (sin (atan (/ eh (* ew (tan t)))))))
t_1))))
double code(double eh, double ew, double t) {
double t_1 = fabs((ew * sin(t)));
double tmp;
if (ew <= -6e+72) {
tmp = t_1;
} else if (ew <= 6e+69) {
tmp = fabs(((eh * cos(t)) * 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 = abs((ew * sin(t)))
if (ew <= (-6d+72)) then
tmp = t_1
else if (ew <= 6d+69) then
tmp = abs(((eh * cos(t)) * 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.abs((ew * Math.sin(t)));
double tmp;
if (ew <= -6e+72) {
tmp = t_1;
} else if (ew <= 6e+69) {
tmp = Math.abs(((eh * Math.cos(t)) * Math.sin(Math.atan((eh / (ew * Math.tan(t)))))));
} else {
tmp = t_1;
}
return tmp;
}
def code(eh, ew, t): t_1 = math.fabs((ew * math.sin(t))) tmp = 0 if ew <= -6e+72: tmp = t_1 elif ew <= 6e+69: tmp = math.fabs(((eh * math.cos(t)) * math.sin(math.atan((eh / (ew * math.tan(t))))))) else: tmp = t_1 return tmp
function code(eh, ew, t) t_1 = abs(Float64(ew * sin(t))) tmp = 0.0 if (ew <= -6e+72) tmp = t_1; elseif (ew <= 6e+69) tmp = abs(Float64(Float64(eh * cos(t)) * 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 = abs((ew * sin(t))); tmp = 0.0; if (ew <= -6e+72) tmp = t_1; elseif (ew <= 6e+69) tmp = abs(((eh * cos(t)) * sin(atan((eh / (ew * tan(t))))))); else tmp = t_1; end tmp_2 = tmp; end
code[eh_, ew_, t_] := Block[{t$95$1 = N[Abs[N[(ew * N[Sin[t], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[ew, -6e+72], t$95$1, If[LessEqual[ew, 6e+69], N[Abs[N[(N[(eh * N[Cos[t], $MachinePrecision]), $MachinePrecision] * 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 := \left|ew \cdot \sin t\right|\\
\mathbf{if}\;ew \leq -6 \cdot 10^{+72}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;ew \leq 6 \cdot 10^{+69}:\\
\;\;\;\;\left|\left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{eh}{ew \cdot \tan t}\right)\right|\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if ew < -6.00000000000000006e72 or 5.99999999999999967e69 < ew Initial program 99.8%
cos-atanN/A
inv-powN/A
pow1/2N/A
pow-powN/A
pow-lowering-pow.f64N/A
Applied egg-rr99.8%
Taylor expanded in ew around inf
*-lowering-*.f64N/A
sin-lowering-sin.f6472.0
Simplified72.0%
if -6.00000000000000006e72 < ew < 5.99999999999999967e69Initial program 99.8%
Taylor expanded in ew around 0
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
atan-lowering-atan.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
tan-lowering-tan.f64N/A
*-lowering-*.f64N/A
cos-lowering-cos.f6482.8
Simplified82.8%
Final simplification79.1%
(FPCore (eh ew t)
:precision binary64
(let* ((t_1 (fabs (* ew (sin t))))
(t_2 (* eh (cos t)))
(t_3 (fabs (* t_2 (sin (atan (/ eh (* ew t)))))))
(t_4
(fabs
(*
t_2
(sin
(atan
(/
(+ (/ eh ew) (/ (* -0.3333333333333333 (* eh (* t t))) ew))
t)))))))
(if (<= eh -2.8e+55)
t_3
(if (<= eh -1.6e+36)
t_1
(if (<= eh -8.8e-118)
t_4
(if (<= eh 3.6e-150) t_1 (if (<= eh 1.72e+227) t_4 t_3)))))))
double code(double eh, double ew, double t) {
double t_1 = fabs((ew * sin(t)));
double t_2 = eh * cos(t);
double t_3 = fabs((t_2 * sin(atan((eh / (ew * t))))));
double t_4 = fabs((t_2 * sin(atan((((eh / ew) + ((-0.3333333333333333 * (eh * (t * t))) / ew)) / t)))));
double tmp;
if (eh <= -2.8e+55) {
tmp = t_3;
} else if (eh <= -1.6e+36) {
tmp = t_1;
} else if (eh <= -8.8e-118) {
tmp = t_4;
} else if (eh <= 3.6e-150) {
tmp = t_1;
} else if (eh <= 1.72e+227) {
tmp = t_4;
} else {
tmp = 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) :: t_4
real(8) :: tmp
t_1 = abs((ew * sin(t)))
t_2 = eh * cos(t)
t_3 = abs((t_2 * sin(atan((eh / (ew * t))))))
t_4 = abs((t_2 * sin(atan((((eh / ew) + (((-0.3333333333333333d0) * (eh * (t * t))) / ew)) / t)))))
if (eh <= (-2.8d+55)) then
tmp = t_3
else if (eh <= (-1.6d+36)) then
tmp = t_1
else if (eh <= (-8.8d-118)) then
tmp = t_4
else if (eh <= 3.6d-150) then
tmp = t_1
else if (eh <= 1.72d+227) then
tmp = t_4
else
tmp = t_3
end if
code = tmp
end function
public static double code(double eh, double ew, double t) {
double t_1 = Math.abs((ew * Math.sin(t)));
double t_2 = eh * Math.cos(t);
double t_3 = Math.abs((t_2 * Math.sin(Math.atan((eh / (ew * t))))));
double t_4 = Math.abs((t_2 * Math.sin(Math.atan((((eh / ew) + ((-0.3333333333333333 * (eh * (t * t))) / ew)) / t)))));
double tmp;
if (eh <= -2.8e+55) {
tmp = t_3;
} else if (eh <= -1.6e+36) {
tmp = t_1;
} else if (eh <= -8.8e-118) {
tmp = t_4;
} else if (eh <= 3.6e-150) {
tmp = t_1;
} else if (eh <= 1.72e+227) {
tmp = t_4;
} else {
tmp = t_3;
}
return tmp;
}
def code(eh, ew, t): t_1 = math.fabs((ew * math.sin(t))) t_2 = eh * math.cos(t) t_3 = math.fabs((t_2 * math.sin(math.atan((eh / (ew * t)))))) t_4 = math.fabs((t_2 * math.sin(math.atan((((eh / ew) + ((-0.3333333333333333 * (eh * (t * t))) / ew)) / t))))) tmp = 0 if eh <= -2.8e+55: tmp = t_3 elif eh <= -1.6e+36: tmp = t_1 elif eh <= -8.8e-118: tmp = t_4 elif eh <= 3.6e-150: tmp = t_1 elif eh <= 1.72e+227: tmp = t_4 else: tmp = t_3 return tmp
function code(eh, ew, t) t_1 = abs(Float64(ew * sin(t))) t_2 = Float64(eh * cos(t)) t_3 = abs(Float64(t_2 * sin(atan(Float64(eh / Float64(ew * t)))))) t_4 = abs(Float64(t_2 * sin(atan(Float64(Float64(Float64(eh / ew) + Float64(Float64(-0.3333333333333333 * Float64(eh * Float64(t * t))) / ew)) / t))))) tmp = 0.0 if (eh <= -2.8e+55) tmp = t_3; elseif (eh <= -1.6e+36) tmp = t_1; elseif (eh <= -8.8e-118) tmp = t_4; elseif (eh <= 3.6e-150) tmp = t_1; elseif (eh <= 1.72e+227) tmp = t_4; else tmp = t_3; end return tmp end
function tmp_2 = code(eh, ew, t) t_1 = abs((ew * sin(t))); t_2 = eh * cos(t); t_3 = abs((t_2 * sin(atan((eh / (ew * t)))))); t_4 = abs((t_2 * sin(atan((((eh / ew) + ((-0.3333333333333333 * (eh * (t * t))) / ew)) / t))))); tmp = 0.0; if (eh <= -2.8e+55) tmp = t_3; elseif (eh <= -1.6e+36) tmp = t_1; elseif (eh <= -8.8e-118) tmp = t_4; elseif (eh <= 3.6e-150) tmp = t_1; elseif (eh <= 1.72e+227) tmp = t_4; else tmp = t_3; end tmp_2 = tmp; end
code[eh_, ew_, t_] := Block[{t$95$1 = N[Abs[N[(ew * N[Sin[t], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[(eh * N[Cos[t], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[Abs[N[(t$95$2 * N[Sin[N[ArcTan[N[(eh / N[(ew * t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$4 = N[Abs[N[(t$95$2 * N[Sin[N[ArcTan[N[(N[(N[(eh / ew), $MachinePrecision] + N[(N[(-0.3333333333333333 * N[(eh * N[(t * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / ew), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[eh, -2.8e+55], t$95$3, If[LessEqual[eh, -1.6e+36], t$95$1, If[LessEqual[eh, -8.8e-118], t$95$4, If[LessEqual[eh, 3.6e-150], t$95$1, If[LessEqual[eh, 1.72e+227], t$95$4, t$95$3]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left|ew \cdot \sin t\right|\\
t_2 := eh \cdot \cos t\\
t_3 := \left|t\_2 \cdot \sin \tan^{-1} \left(\frac{eh}{ew \cdot t}\right)\right|\\
t_4 := \left|t\_2 \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew} + \frac{-0.3333333333333333 \cdot \left(eh \cdot \left(t \cdot t\right)\right)}{ew}}{t}\right)\right|\\
\mathbf{if}\;eh \leq -2.8 \cdot 10^{+55}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;eh \leq -1.6 \cdot 10^{+36}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;eh \leq -8.8 \cdot 10^{-118}:\\
\;\;\;\;t\_4\\
\mathbf{elif}\;eh \leq 3.6 \cdot 10^{-150}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;eh \leq 1.72 \cdot 10^{+227}:\\
\;\;\;\;t\_4\\
\mathbf{else}:\\
\;\;\;\;t\_3\\
\end{array}
\end{array}
if eh < -2.8000000000000001e55 or 1.71999999999999995e227 < eh Initial program 99.8%
cos-atanN/A
inv-powN/A
pow1/2N/A
pow-powN/A
pow-lowering-pow.f64N/A
Applied egg-rr99.8%
Taylor expanded in ew around 0
associate-*r*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
cos-lowering-cos.f64N/A
sin-lowering-sin.f64N/A
atan-lowering-atan.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
tan-lowering-tan.f6492.7
Simplified92.7%
Taylor expanded in t around 0
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f6485.8
Simplified85.8%
if -2.8000000000000001e55 < eh < -1.5999999999999999e36 or -8.79999999999999934e-118 < eh < 3.6000000000000002e-150Initial program 99.8%
cos-atanN/A
inv-powN/A
pow1/2N/A
pow-powN/A
pow-lowering-pow.f64N/A
Applied egg-rr99.8%
Taylor expanded in ew around inf
*-lowering-*.f64N/A
sin-lowering-sin.f6478.3
Simplified78.3%
if -1.5999999999999999e36 < eh < -8.79999999999999934e-118 or 3.6000000000000002e-150 < eh < 1.71999999999999995e227Initial program 99.8%
cos-atanN/A
inv-powN/A
pow1/2N/A
pow-powN/A
pow-lowering-pow.f64N/A
Applied egg-rr99.8%
Taylor expanded in ew around 0
associate-*r*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
cos-lowering-cos.f64N/A
sin-lowering-sin.f64N/A
atan-lowering-atan.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
tan-lowering-tan.f6475.0
Simplified75.0%
Taylor expanded in t around 0
/-lowering-/.f64N/A
+-lowering-+.f64N/A
associate-*r/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
/-lowering-/.f6471.8
Simplified71.8%
Final simplification77.3%
(FPCore (eh ew t)
:precision binary64
(let* ((t_1 (fabs (* ew (sin t)))))
(if (<= t -3e+134)
t_1
(if (<= t -0.000112)
(fabs (* (* eh (cos t)) (sin (atan (/ eh (* ew t))))))
(if (<= t 40000.0)
(fabs (+ (* ew t) (* eh (sin (atan (/ eh (* ew (tan t))))))))
t_1)))))
double code(double eh, double ew, double t) {
double t_1 = fabs((ew * sin(t)));
double tmp;
if (t <= -3e+134) {
tmp = t_1;
} else if (t <= -0.000112) {
tmp = fabs(((eh * cos(t)) * sin(atan((eh / (ew * t))))));
} else if (t <= 40000.0) {
tmp = fabs(((ew * t) + (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 = abs((ew * sin(t)))
if (t <= (-3d+134)) then
tmp = t_1
else if (t <= (-0.000112d0)) then
tmp = abs(((eh * cos(t)) * sin(atan((eh / (ew * t))))))
else if (t <= 40000.0d0) then
tmp = abs(((ew * t) + (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.abs((ew * Math.sin(t)));
double tmp;
if (t <= -3e+134) {
tmp = t_1;
} else if (t <= -0.000112) {
tmp = Math.abs(((eh * Math.cos(t)) * Math.sin(Math.atan((eh / (ew * t))))));
} else if (t <= 40000.0) {
tmp = Math.abs(((ew * t) + (eh * Math.sin(Math.atan((eh / (ew * Math.tan(t))))))));
} else {
tmp = t_1;
}
return tmp;
}
def code(eh, ew, t): t_1 = math.fabs((ew * math.sin(t))) tmp = 0 if t <= -3e+134: tmp = t_1 elif t <= -0.000112: tmp = math.fabs(((eh * math.cos(t)) * math.sin(math.atan((eh / (ew * t)))))) elif t <= 40000.0: tmp = math.fabs(((ew * t) + (eh * math.sin(math.atan((eh / (ew * math.tan(t)))))))) else: tmp = t_1 return tmp
function code(eh, ew, t) t_1 = abs(Float64(ew * sin(t))) tmp = 0.0 if (t <= -3e+134) tmp = t_1; elseif (t <= -0.000112) tmp = abs(Float64(Float64(eh * cos(t)) * sin(atan(Float64(eh / Float64(ew * t)))))); elseif (t <= 40000.0) tmp = abs(Float64(Float64(ew * t) + 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 = abs((ew * sin(t))); tmp = 0.0; if (t <= -3e+134) tmp = t_1; elseif (t <= -0.000112) tmp = abs(((eh * cos(t)) * sin(atan((eh / (ew * t)))))); elseif (t <= 40000.0) tmp = abs(((ew * t) + (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[Abs[N[(ew * N[Sin[t], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t, -3e+134], t$95$1, If[LessEqual[t, -0.000112], N[Abs[N[(N[(eh * N[Cos[t], $MachinePrecision]), $MachinePrecision] * N[Sin[N[ArcTan[N[(eh / N[(ew * t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[t, 40000.0], N[Abs[N[(N[(ew * t), $MachinePrecision] + N[(eh * N[Sin[N[ArcTan[N[(eh / N[(ew * N[Tan[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left|ew \cdot \sin t\right|\\
\mathbf{if}\;t \leq -3 \cdot 10^{+134}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq -0.000112:\\
\;\;\;\;\left|\left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{eh}{ew \cdot t}\right)\right|\\
\mathbf{elif}\;t \leq 40000:\\
\;\;\;\;\left|ew \cdot t + eh \cdot \sin \tan^{-1} \left(\frac{eh}{ew \cdot \tan t}\right)\right|\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -2.99999999999999997e134 or 4e4 < t Initial program 99.7%
cos-atanN/A
inv-powN/A
pow1/2N/A
pow-powN/A
pow-lowering-pow.f64N/A
Applied egg-rr99.7%
Taylor expanded in ew around inf
*-lowering-*.f64N/A
sin-lowering-sin.f6446.4
Simplified46.4%
if -2.99999999999999997e134 < t < -1.11999999999999998e-4Initial program 99.7%
cos-atanN/A
inv-powN/A
pow1/2N/A
pow-powN/A
pow-lowering-pow.f64N/A
Applied egg-rr99.7%
Taylor expanded in ew around 0
associate-*r*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
cos-lowering-cos.f64N/A
sin-lowering-sin.f64N/A
atan-lowering-atan.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
tan-lowering-tan.f6463.7
Simplified63.7%
Taylor expanded in t around 0
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f6456.6
Simplified56.6%
if -1.11999999999999998e-4 < t < 4e4Initial program 100.0%
cos-atanN/A
inv-powN/A
pow1/2N/A
pow-powN/A
pow-lowering-pow.f64N/A
Applied egg-rr100.0%
Taylor expanded in eh around 0
+-lowering-+.f64N/A
associate-*r*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
cos-lowering-cos.f64N/A
sin-lowering-sin.f64N/A
atan-lowering-atan.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
tan-lowering-tan.f64N/A
*-lowering-*.f64N/A
sin-lowering-sin.f6499.4
Simplified99.4%
Taylor expanded in t around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
atan-lowering-atan.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
tan-lowering-tan.f64N/A
*-commutativeN/A
*-lowering-*.f6498.7
Simplified98.7%
Final simplification71.9%
(FPCore (eh ew t) :precision binary64 (let* ((t_1 (fabs (* (* eh (cos t)) (sin (atan (/ eh (* ew t)))))))) (if (<= eh -3e+55) t_1 (if (<= eh 4e-52) (fabs (* ew (sin t))) t_1))))
double code(double eh, double ew, double t) {
double t_1 = fabs(((eh * cos(t)) * sin(atan((eh / (ew * t))))));
double tmp;
if (eh <= -3e+55) {
tmp = t_1;
} else if (eh <= 4e-52) {
tmp = fabs((ew * sin(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 = abs(((eh * cos(t)) * sin(atan((eh / (ew * t))))))
if (eh <= (-3d+55)) then
tmp = t_1
else if (eh <= 4d-52) then
tmp = abs((ew * sin(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.abs(((eh * Math.cos(t)) * Math.sin(Math.atan((eh / (ew * t))))));
double tmp;
if (eh <= -3e+55) {
tmp = t_1;
} else if (eh <= 4e-52) {
tmp = Math.abs((ew * Math.sin(t)));
} else {
tmp = t_1;
}
return tmp;
}
def code(eh, ew, t): t_1 = math.fabs(((eh * math.cos(t)) * math.sin(math.atan((eh / (ew * t)))))) tmp = 0 if eh <= -3e+55: tmp = t_1 elif eh <= 4e-52: tmp = math.fabs((ew * math.sin(t))) else: tmp = t_1 return tmp
function code(eh, ew, t) t_1 = abs(Float64(Float64(eh * cos(t)) * sin(atan(Float64(eh / Float64(ew * t)))))) tmp = 0.0 if (eh <= -3e+55) tmp = t_1; elseif (eh <= 4e-52) tmp = abs(Float64(ew * sin(t))); else tmp = t_1; end return tmp end
function tmp_2 = code(eh, ew, t) t_1 = abs(((eh * cos(t)) * sin(atan((eh / (ew * t)))))); tmp = 0.0; if (eh <= -3e+55) tmp = t_1; elseif (eh <= 4e-52) tmp = abs((ew * sin(t))); else tmp = t_1; end tmp_2 = tmp; end
code[eh_, ew_, t_] := Block[{t$95$1 = N[Abs[N[(N[(eh * N[Cos[t], $MachinePrecision]), $MachinePrecision] * N[Sin[N[ArcTan[N[(eh / N[(ew * t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[eh, -3e+55], t$95$1, If[LessEqual[eh, 4e-52], N[Abs[N[(ew * N[Sin[t], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left|\left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{eh}{ew \cdot t}\right)\right|\\
\mathbf{if}\;eh \leq -3 \cdot 10^{+55}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;eh \leq 4 \cdot 10^{-52}:\\
\;\;\;\;\left|ew \cdot \sin t\right|\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if eh < -3.00000000000000017e55 or 4e-52 < eh Initial program 99.8%
cos-atanN/A
inv-powN/A
pow1/2N/A
pow-powN/A
pow-lowering-pow.f64N/A
Applied egg-rr99.8%
Taylor expanded in ew around 0
associate-*r*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
cos-lowering-cos.f64N/A
sin-lowering-sin.f64N/A
atan-lowering-atan.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
tan-lowering-tan.f6487.9
Simplified87.9%
Taylor expanded in t around 0
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f6475.1
Simplified75.1%
if -3.00000000000000017e55 < eh < 4e-52Initial program 99.8%
cos-atanN/A
inv-powN/A
pow1/2N/A
pow-powN/A
pow-lowering-pow.f64N/A
Applied egg-rr99.8%
Taylor expanded in ew around inf
*-lowering-*.f64N/A
sin-lowering-sin.f6463.8
Simplified63.8%
Final simplification69.7%
(FPCore (eh ew t)
:precision binary64
(let* ((t_1 (fabs (* ew (sin t)))))
(if (<= t -3.2e-97)
t_1
(if (<= t 1.55e-21)
(fabs
(*
eh
(sin
(atan (/ eh (* t (+ ew (* (* ew (* t t)) 0.3333333333333333))))))))
t_1))))
double code(double eh, double ew, double t) {
double t_1 = fabs((ew * sin(t)));
double tmp;
if (t <= -3.2e-97) {
tmp = t_1;
} else if (t <= 1.55e-21) {
tmp = fabs((eh * sin(atan((eh / (t * (ew + ((ew * (t * t)) * 0.3333333333333333))))))));
} 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 = abs((ew * sin(t)))
if (t <= (-3.2d-97)) then
tmp = t_1
else if (t <= 1.55d-21) then
tmp = abs((eh * sin(atan((eh / (t * (ew + ((ew * (t * t)) * 0.3333333333333333d0))))))))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double eh, double ew, double t) {
double t_1 = Math.abs((ew * Math.sin(t)));
double tmp;
if (t <= -3.2e-97) {
tmp = t_1;
} else if (t <= 1.55e-21) {
tmp = Math.abs((eh * Math.sin(Math.atan((eh / (t * (ew + ((ew * (t * t)) * 0.3333333333333333))))))));
} else {
tmp = t_1;
}
return tmp;
}
def code(eh, ew, t): t_1 = math.fabs((ew * math.sin(t))) tmp = 0 if t <= -3.2e-97: tmp = t_1 elif t <= 1.55e-21: tmp = math.fabs((eh * math.sin(math.atan((eh / (t * (ew + ((ew * (t * t)) * 0.3333333333333333)))))))) else: tmp = t_1 return tmp
function code(eh, ew, t) t_1 = abs(Float64(ew * sin(t))) tmp = 0.0 if (t <= -3.2e-97) tmp = t_1; elseif (t <= 1.55e-21) tmp = abs(Float64(eh * sin(atan(Float64(eh / Float64(t * Float64(ew + Float64(Float64(ew * Float64(t * t)) * 0.3333333333333333)))))))); else tmp = t_1; end return tmp end
function tmp_2 = code(eh, ew, t) t_1 = abs((ew * sin(t))); tmp = 0.0; if (t <= -3.2e-97) tmp = t_1; elseif (t <= 1.55e-21) tmp = abs((eh * sin(atan((eh / (t * (ew + ((ew * (t * t)) * 0.3333333333333333)))))))); else tmp = t_1; end tmp_2 = tmp; end
code[eh_, ew_, t_] := Block[{t$95$1 = N[Abs[N[(ew * N[Sin[t], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t, -3.2e-97], t$95$1, If[LessEqual[t, 1.55e-21], N[Abs[N[(eh * N[Sin[N[ArcTan[N[(eh / N[(t * N[(ew + N[(N[(ew * N[(t * t), $MachinePrecision]), $MachinePrecision] * 0.3333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left|ew \cdot \sin t\right|\\
\mathbf{if}\;t \leq -3.2 \cdot 10^{-97}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 1.55 \cdot 10^{-21}:\\
\;\;\;\;\left|eh \cdot \sin \tan^{-1} \left(\frac{eh}{t \cdot \left(ew + \left(ew \cdot \left(t \cdot t\right)\right) \cdot 0.3333333333333333\right)}\right)\right|\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -3.1999999999999998e-97 or 1.5499999999999999e-21 < t Initial program 99.7%
cos-atanN/A
inv-powN/A
pow1/2N/A
pow-powN/A
pow-lowering-pow.f64N/A
Applied egg-rr99.7%
Taylor expanded in ew around inf
*-lowering-*.f64N/A
sin-lowering-sin.f6447.0
Simplified47.0%
if -3.1999999999999998e-97 < t < 1.5499999999999999e-21Initial program 100.0%
Taylor expanded in t around 0
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
atan-lowering-atan.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
tan-lowering-tan.f6479.4
Simplified79.4%
Taylor expanded in t around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6479.4
Simplified79.4%
(FPCore (eh ew t)
:precision binary64
(let* ((t_1 (fabs (* ew (sin t)))))
(if (<= t -3.4e-97)
t_1
(if (<= t 2.8e-17) (fabs (* eh (sin (atan (/ eh (* ew t)))))) t_1))))
double code(double eh, double ew, double t) {
double t_1 = fabs((ew * sin(t)));
double tmp;
if (t <= -3.4e-97) {
tmp = t_1;
} else if (t <= 2.8e-17) {
tmp = fabs((eh * sin(atan((eh / (ew * 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 = abs((ew * sin(t)))
if (t <= (-3.4d-97)) then
tmp = t_1
else if (t <= 2.8d-17) then
tmp = abs((eh * sin(atan((eh / (ew * 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.abs((ew * Math.sin(t)));
double tmp;
if (t <= -3.4e-97) {
tmp = t_1;
} else if (t <= 2.8e-17) {
tmp = Math.abs((eh * Math.sin(Math.atan((eh / (ew * t))))));
} else {
tmp = t_1;
}
return tmp;
}
def code(eh, ew, t): t_1 = math.fabs((ew * math.sin(t))) tmp = 0 if t <= -3.4e-97: tmp = t_1 elif t <= 2.8e-17: tmp = math.fabs((eh * math.sin(math.atan((eh / (ew * t)))))) else: tmp = t_1 return tmp
function code(eh, ew, t) t_1 = abs(Float64(ew * sin(t))) tmp = 0.0 if (t <= -3.4e-97) tmp = t_1; elseif (t <= 2.8e-17) tmp = abs(Float64(eh * sin(atan(Float64(eh / Float64(ew * t)))))); else tmp = t_1; end return tmp end
function tmp_2 = code(eh, ew, t) t_1 = abs((ew * sin(t))); tmp = 0.0; if (t <= -3.4e-97) tmp = t_1; elseif (t <= 2.8e-17) tmp = abs((eh * sin(atan((eh / (ew * t)))))); else tmp = t_1; end tmp_2 = tmp; end
code[eh_, ew_, t_] := Block[{t$95$1 = N[Abs[N[(ew * N[Sin[t], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t, -3.4e-97], t$95$1, If[LessEqual[t, 2.8e-17], N[Abs[N[(eh * N[Sin[N[ArcTan[N[(eh / N[(ew * t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left|ew \cdot \sin t\right|\\
\mathbf{if}\;t \leq -3.4 \cdot 10^{-97}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 2.8 \cdot 10^{-17}:\\
\;\;\;\;\left|eh \cdot \sin \tan^{-1} \left(\frac{eh}{ew \cdot t}\right)\right|\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -3.3999999999999999e-97 or 2.7999999999999999e-17 < t Initial program 99.7%
cos-atanN/A
inv-powN/A
pow1/2N/A
pow-powN/A
pow-lowering-pow.f64N/A
Applied egg-rr99.7%
Taylor expanded in ew around inf
*-lowering-*.f64N/A
sin-lowering-sin.f6447.0
Simplified47.0%
if -3.3999999999999999e-97 < t < 2.7999999999999999e-17Initial program 100.0%
Taylor expanded in t around 0
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
atan-lowering-atan.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
tan-lowering-tan.f6479.4
Simplified79.4%
Taylor expanded in t around 0
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f6479.4
Simplified79.4%
Final simplification59.3%
(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%
cos-atanN/A
inv-powN/A
pow1/2N/A
pow-powN/A
pow-lowering-pow.f64N/A
Applied egg-rr99.8%
Taylor expanded in ew around inf
*-lowering-*.f64N/A
sin-lowering-sin.f6438.6
Simplified38.6%
(FPCore (eh ew t) :precision binary64 (fabs (* ew t)))
double code(double eh, double ew, double t) {
return fabs((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 * t))
end function
public static double code(double eh, double ew, double t) {
return Math.abs((ew * t));
}
def code(eh, ew, t): return math.fabs((ew * t))
function code(eh, ew, t) return abs(Float64(ew * t)) end
function tmp = code(eh, ew, t) tmp = abs((ew * t)); end
code[eh_, ew_, t_] := N[Abs[N[(ew * t), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\left|ew \cdot t\right|
\end{array}
Initial program 99.8%
cos-atanN/A
inv-powN/A
pow1/2N/A
pow-powN/A
pow-lowering-pow.f64N/A
Applied egg-rr99.8%
Taylor expanded in ew around inf
*-lowering-*.f64N/A
sin-lowering-sin.f6438.6
Simplified38.6%
Taylor expanded in t around 0
*-commutativeN/A
*-lowering-*.f6417.7
Simplified17.7%
Final simplification17.7%
herbie shell --seed 2024191
(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))))))))