
(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 10 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) (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.8%
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
cos-atanN/A
un-div-invN/A
/-lowering-/.f64N/A
sin-lowering-sin.f64N/A
hypot-1-defN/A
hypot-lowering-hypot.f64N/A
associate-/l/N/A
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
tan-lowering-tan.f6499.8%
Applied egg-rr99.8%
Final simplification99.8%
(FPCore (eh ew t) :precision binary64 (fabs (+ (* (* eh (cos t)) (sin (atan (/ eh (* ew (tan t)))))) (* (sin t) ew))))
double code(double eh, double ew, double t) {
return fabs((((eh * cos(t)) * sin(atan((eh / (ew * tan(t)))))) + (sin(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)))))) + (sin(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)))))) + (Math.sin(t) * ew)));
}
def code(eh, ew, t): return math.fabs((((eh * math.cos(t)) * math.sin(math.atan((eh / (ew * math.tan(t)))))) + (math.sin(t) * ew)))
function code(eh, ew, t) return abs(Float64(Float64(Float64(eh * cos(t)) * sin(atan(Float64(eh / Float64(ew * tan(t)))))) + Float64(sin(t) * ew))) end
function tmp = code(eh, ew, t) tmp = abs((((eh * cos(t)) * sin(atan((eh / (ew * tan(t)))))) + (sin(t) * ew))); end
code[eh_, ew_, t_] := N[Abs[N[(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] + N[(N[Sin[t], $MachinePrecision] * ew), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\left|\left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{eh}{ew \cdot \tan t}\right) + \sin t \cdot ew\right|
\end{array}
Initial program 99.8%
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
cos-atanN/A
un-div-invN/A
/-lowering-/.f64N/A
sin-lowering-sin.f64N/A
hypot-1-defN/A
hypot-lowering-hypot.f64N/A
associate-/l/N/A
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
tan-lowering-tan.f6499.8%
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.9%
Simplified98.9%
Final simplification98.9%
(FPCore (eh ew t)
:precision binary64
(let* ((t_1 (fabs (* (sin t) ew))) (t_2 (sin (atan (/ eh (* ew (tan t)))))))
(if (<= t -3.9e+145)
(fabs (* (* eh (cos t)) t_2))
(if (<= t -0.0021)
t_1
(if (<= t 1.2e-6) (fabs (+ (* eh t_2) (* t ew))) t_1)))))
double code(double eh, double ew, double t) {
double t_1 = fabs((sin(t) * ew));
double t_2 = sin(atan((eh / (ew * tan(t)))));
double tmp;
if (t <= -3.9e+145) {
tmp = fabs(((eh * cos(t)) * t_2));
} else if (t <= -0.0021) {
tmp = t_1;
} else if (t <= 1.2e-6) {
tmp = fabs(((eh * t_2) + (t * ew)));
} 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) :: t_2
real(8) :: tmp
t_1 = abs((sin(t) * ew))
t_2 = sin(atan((eh / (ew * tan(t)))))
if (t <= (-3.9d+145)) then
tmp = abs(((eh * cos(t)) * t_2))
else if (t <= (-0.0021d0)) then
tmp = t_1
else if (t <= 1.2d-6) then
tmp = abs(((eh * t_2) + (t * ew)))
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((Math.sin(t) * ew));
double t_2 = Math.sin(Math.atan((eh / (ew * Math.tan(t)))));
double tmp;
if (t <= -3.9e+145) {
tmp = Math.abs(((eh * Math.cos(t)) * t_2));
} else if (t <= -0.0021) {
tmp = t_1;
} else if (t <= 1.2e-6) {
tmp = Math.abs(((eh * t_2) + (t * ew)));
} else {
tmp = t_1;
}
return tmp;
}
def code(eh, ew, t): t_1 = math.fabs((math.sin(t) * ew)) t_2 = math.sin(math.atan((eh / (ew * math.tan(t))))) tmp = 0 if t <= -3.9e+145: tmp = math.fabs(((eh * math.cos(t)) * t_2)) elif t <= -0.0021: tmp = t_1 elif t <= 1.2e-6: tmp = math.fabs(((eh * t_2) + (t * ew))) else: tmp = t_1 return tmp
function code(eh, ew, t) t_1 = abs(Float64(sin(t) * ew)) t_2 = sin(atan(Float64(eh / Float64(ew * tan(t))))) tmp = 0.0 if (t <= -3.9e+145) tmp = abs(Float64(Float64(eh * cos(t)) * t_2)); elseif (t <= -0.0021) tmp = t_1; elseif (t <= 1.2e-6) tmp = abs(Float64(Float64(eh * t_2) + Float64(t * ew))); else tmp = t_1; end return tmp end
function tmp_2 = code(eh, ew, t) t_1 = abs((sin(t) * ew)); t_2 = sin(atan((eh / (ew * tan(t))))); tmp = 0.0; if (t <= -3.9e+145) tmp = abs(((eh * cos(t)) * t_2)); elseif (t <= -0.0021) tmp = t_1; elseif (t <= 1.2e-6) tmp = abs(((eh * t_2) + (t * ew))); else tmp = t_1; end tmp_2 = tmp; end
code[eh_, ew_, t_] := Block[{t$95$1 = N[Abs[N[(N[Sin[t], $MachinePrecision] * ew), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Sin[N[ArcTan[N[(eh / N[(ew * N[Tan[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t, -3.9e+145], N[Abs[N[(N[(eh * N[Cos[t], $MachinePrecision]), $MachinePrecision] * t$95$2), $MachinePrecision]], $MachinePrecision], If[LessEqual[t, -0.0021], t$95$1, If[LessEqual[t, 1.2e-6], N[Abs[N[(N[(eh * t$95$2), $MachinePrecision] + N[(t * ew), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left|\sin t \cdot ew\right|\\
t_2 := \sin \tan^{-1} \left(\frac{eh}{ew \cdot \tan t}\right)\\
\mathbf{if}\;t \leq -3.9 \cdot 10^{+145}:\\
\;\;\;\;\left|\left(eh \cdot \cos t\right) \cdot t\_2\right|\\
\mathbf{elif}\;t \leq -0.0021:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 1.2 \cdot 10^{-6}:\\
\;\;\;\;\left|eh \cdot t\_2 + t \cdot ew\right|\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -3.8999999999999998e145Initial program 99.7%
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.f6458.8%
Simplified58.8%
if -3.8999999999999998e145 < t < -0.00209999999999999987 or 1.1999999999999999e-6 < t Initial program 99.7%
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
cos-atanN/A
un-div-invN/A
/-lowering-/.f64N/A
sin-lowering-sin.f64N/A
hypot-1-defN/A
hypot-lowering-hypot.f64N/A
associate-/l/N/A
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
tan-lowering-tan.f6499.7%
Applied egg-rr99.7%
Taylor expanded in eh around 0
*-lowering-*.f64N/A
sin-lowering-sin.f6460.8%
Simplified60.8%
if -0.00209999999999999987 < t < 1.1999999999999999e-6Initial program 100.0%
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
cos-atanN/A
un-div-invN/A
/-lowering-/.f64N/A
sin-lowering-sin.f64N/A
hypot-1-defN/A
hypot-lowering-hypot.f64N/A
associate-/l/N/A
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
tan-lowering-tan.f64100.0%
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.5%
Simplified99.5%
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-*.f6499.5%
Simplified99.5%
Final simplification81.2%
(FPCore (eh ew t)
:precision binary64
(let* ((t_1 (fabs (* (sin t) ew))))
(if (<= t -0.01)
t_1
(if (<= t 1.2e-6)
(fabs (+ (* eh (sin (atan (/ eh (* ew (tan t)))))) (* t ew)))
t_1))))
double code(double eh, double ew, double t) {
double t_1 = fabs((sin(t) * ew));
double tmp;
if (t <= -0.01) {
tmp = t_1;
} else if (t <= 1.2e-6) {
tmp = fabs(((eh * sin(atan((eh / (ew * tan(t)))))) + (t * ew)));
} 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((sin(t) * ew))
if (t <= (-0.01d0)) then
tmp = t_1
else if (t <= 1.2d-6) then
tmp = abs(((eh * sin(atan((eh / (ew * tan(t)))))) + (t * ew)))
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((Math.sin(t) * ew));
double tmp;
if (t <= -0.01) {
tmp = t_1;
} else if (t <= 1.2e-6) {
tmp = Math.abs(((eh * Math.sin(Math.atan((eh / (ew * Math.tan(t)))))) + (t * ew)));
} else {
tmp = t_1;
}
return tmp;
}
def code(eh, ew, t): t_1 = math.fabs((math.sin(t) * ew)) tmp = 0 if t <= -0.01: tmp = t_1 elif t <= 1.2e-6: tmp = math.fabs(((eh * math.sin(math.atan((eh / (ew * math.tan(t)))))) + (t * ew))) else: tmp = t_1 return tmp
function code(eh, ew, t) t_1 = abs(Float64(sin(t) * ew)) tmp = 0.0 if (t <= -0.01) tmp = t_1; elseif (t <= 1.2e-6) tmp = abs(Float64(Float64(eh * sin(atan(Float64(eh / Float64(ew * tan(t)))))) + Float64(t * ew))); else tmp = t_1; end return tmp end
function tmp_2 = code(eh, ew, t) t_1 = abs((sin(t) * ew)); tmp = 0.0; if (t <= -0.01) tmp = t_1; elseif (t <= 1.2e-6) tmp = abs(((eh * sin(atan((eh / (ew * tan(t)))))) + (t * ew))); else tmp = t_1; end tmp_2 = tmp; end
code[eh_, ew_, t_] := Block[{t$95$1 = N[Abs[N[(N[Sin[t], $MachinePrecision] * ew), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t, -0.01], t$95$1, If[LessEqual[t, 1.2e-6], N[Abs[N[(N[(eh * N[Sin[N[ArcTan[N[(eh / N[(ew * N[Tan[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + N[(t * ew), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left|\sin t \cdot ew\right|\\
\mathbf{if}\;t \leq -0.01:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 1.2 \cdot 10^{-6}:\\
\;\;\;\;\left|eh \cdot \sin \tan^{-1} \left(\frac{eh}{ew \cdot \tan t}\right) + t \cdot ew\right|\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -0.0100000000000000002 or 1.1999999999999999e-6 < t Initial program 99.7%
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
cos-atanN/A
un-div-invN/A
/-lowering-/.f64N/A
sin-lowering-sin.f64N/A
hypot-1-defN/A
hypot-lowering-hypot.f64N/A
associate-/l/N/A
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
tan-lowering-tan.f6499.7%
Applied egg-rr99.7%
Taylor expanded in eh around 0
*-lowering-*.f64N/A
sin-lowering-sin.f6456.4%
Simplified56.4%
if -0.0100000000000000002 < t < 1.1999999999999999e-6Initial program 100.0%
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
cos-atanN/A
un-div-invN/A
/-lowering-/.f64N/A
sin-lowering-sin.f64N/A
hypot-1-defN/A
hypot-lowering-hypot.f64N/A
associate-/l/N/A
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
tan-lowering-tan.f64100.0%
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.5%
Simplified99.5%
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-*.f6499.5%
Simplified99.5%
Final simplification79.4%
(FPCore (eh ew t) :precision binary64 (if (<= eh -1.55e+50) (fabs eh) (if (<= eh 21000000000.0) (fabs (* (sin t) ew)) (fabs eh))))
double code(double eh, double ew, double t) {
double tmp;
if (eh <= -1.55e+50) {
tmp = fabs(eh);
} else if (eh <= 21000000000.0) {
tmp = fabs((sin(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 (eh <= (-1.55d+50)) then
tmp = abs(eh)
else if (eh <= 21000000000.0d0) then
tmp = abs((sin(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 (eh <= -1.55e+50) {
tmp = Math.abs(eh);
} else if (eh <= 21000000000.0) {
tmp = Math.abs((Math.sin(t) * ew));
} else {
tmp = Math.abs(eh);
}
return tmp;
}
def code(eh, ew, t): tmp = 0 if eh <= -1.55e+50: tmp = math.fabs(eh) elif eh <= 21000000000.0: tmp = math.fabs((math.sin(t) * ew)) else: tmp = math.fabs(eh) return tmp
function code(eh, ew, t) tmp = 0.0 if (eh <= -1.55e+50) tmp = abs(eh); elseif (eh <= 21000000000.0) tmp = abs(Float64(sin(t) * ew)); else tmp = abs(eh); end return tmp end
function tmp_2 = code(eh, ew, t) tmp = 0.0; if (eh <= -1.55e+50) tmp = abs(eh); elseif (eh <= 21000000000.0) tmp = abs((sin(t) * ew)); else tmp = abs(eh); end tmp_2 = tmp; end
code[eh_, ew_, t_] := If[LessEqual[eh, -1.55e+50], N[Abs[eh], $MachinePrecision], If[LessEqual[eh, 21000000000.0], N[Abs[N[(N[Sin[t], $MachinePrecision] * ew), $MachinePrecision]], $MachinePrecision], N[Abs[eh], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;eh \leq -1.55 \cdot 10^{+50}:\\
\;\;\;\;\left|eh\right|\\
\mathbf{elif}\;eh \leq 21000000000:\\
\;\;\;\;\left|\sin t \cdot ew\right|\\
\mathbf{else}:\\
\;\;\;\;\left|eh\right|\\
\end{array}
\end{array}
if eh < -1.55000000000000001e50 or 2.1e10 < eh Initial program 99.9%
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.f6464.2%
Simplified64.2%
sin-atanN/A
associate-/r*N/A
metadata-evalN/A
associate-/l/N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
hypot-undefineN/A
hypot-lowering-hypot.f64N/A
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
tan-lowering-tan.f64N/A
tan-lowering-tan.f6428.2%
Applied egg-rr28.2%
Taylor expanded in eh around inf
Simplified64.4%
if -1.55000000000000001e50 < eh < 2.1e10Initial program 99.8%
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
cos-atanN/A
un-div-invN/A
/-lowering-/.f64N/A
sin-lowering-sin.f64N/A
hypot-1-defN/A
hypot-lowering-hypot.f64N/A
associate-/l/N/A
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
tan-lowering-tan.f6499.8%
Applied egg-rr99.8%
Taylor expanded in eh around 0
*-lowering-*.f64N/A
sin-lowering-sin.f6470.2%
Simplified70.2%
Final simplification67.6%
(FPCore (eh ew t)
:precision binary64
(if (<= ew -4.2e+52)
(fabs (* t ew))
(if (<= ew 9e+139)
(fabs eh)
(fabs
(*
ew
(*
t
(+
1.0
(*
(* t t)
(+
(*
(* t t)
(+ 0.008333333333333333 (* (* t t) -0.0001984126984126984)))
-0.16666666666666666)))))))))
double code(double eh, double ew, double t) {
double tmp;
if (ew <= -4.2e+52) {
tmp = fabs((t * ew));
} else if (ew <= 9e+139) {
tmp = fabs(eh);
} else {
tmp = fabs((ew * (t * (1.0 + ((t * t) * (((t * t) * (0.008333333333333333 + ((t * t) * -0.0001984126984126984))) + -0.16666666666666666))))));
}
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 <= (-4.2d+52)) then
tmp = abs((t * ew))
else if (ew <= 9d+139) then
tmp = abs(eh)
else
tmp = abs((ew * (t * (1.0d0 + ((t * t) * (((t * t) * (0.008333333333333333d0 + ((t * t) * (-0.0001984126984126984d0)))) + (-0.16666666666666666d0)))))))
end if
code = tmp
end function
public static double code(double eh, double ew, double t) {
double tmp;
if (ew <= -4.2e+52) {
tmp = Math.abs((t * ew));
} else if (ew <= 9e+139) {
tmp = Math.abs(eh);
} else {
tmp = Math.abs((ew * (t * (1.0 + ((t * t) * (((t * t) * (0.008333333333333333 + ((t * t) * -0.0001984126984126984))) + -0.16666666666666666))))));
}
return tmp;
}
def code(eh, ew, t): tmp = 0 if ew <= -4.2e+52: tmp = math.fabs((t * ew)) elif ew <= 9e+139: tmp = math.fabs(eh) else: tmp = math.fabs((ew * (t * (1.0 + ((t * t) * (((t * t) * (0.008333333333333333 + ((t * t) * -0.0001984126984126984))) + -0.16666666666666666)))))) return tmp
function code(eh, ew, t) tmp = 0.0 if (ew <= -4.2e+52) tmp = abs(Float64(t * ew)); elseif (ew <= 9e+139) tmp = abs(eh); else tmp = abs(Float64(ew * Float64(t * Float64(1.0 + Float64(Float64(t * t) * Float64(Float64(Float64(t * t) * Float64(0.008333333333333333 + Float64(Float64(t * t) * -0.0001984126984126984))) + -0.16666666666666666)))))); end return tmp end
function tmp_2 = code(eh, ew, t) tmp = 0.0; if (ew <= -4.2e+52) tmp = abs((t * ew)); elseif (ew <= 9e+139) tmp = abs(eh); else tmp = abs((ew * (t * (1.0 + ((t * t) * (((t * t) * (0.008333333333333333 + ((t * t) * -0.0001984126984126984))) + -0.16666666666666666)))))); end tmp_2 = tmp; end
code[eh_, ew_, t_] := If[LessEqual[ew, -4.2e+52], N[Abs[N[(t * ew), $MachinePrecision]], $MachinePrecision], If[LessEqual[ew, 9e+139], N[Abs[eh], $MachinePrecision], N[Abs[N[(ew * N[(t * N[(1.0 + N[(N[(t * t), $MachinePrecision] * N[(N[(N[(t * t), $MachinePrecision] * N[(0.008333333333333333 + N[(N[(t * t), $MachinePrecision] * -0.0001984126984126984), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + -0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;ew \leq -4.2 \cdot 10^{+52}:\\
\;\;\;\;\left|t \cdot ew\right|\\
\mathbf{elif}\;ew \leq 9 \cdot 10^{+139}:\\
\;\;\;\;\left|eh\right|\\
\mathbf{else}:\\
\;\;\;\;\left|ew \cdot \left(t \cdot \left(1 + \left(t \cdot t\right) \cdot \left(\left(t \cdot t\right) \cdot \left(0.008333333333333333 + \left(t \cdot t\right) \cdot -0.0001984126984126984\right) + -0.16666666666666666\right)\right)\right)\right|\\
\end{array}
\end{array}
if ew < -4.2e52Initial program 99.8%
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
cos-atanN/A
un-div-invN/A
/-lowering-/.f64N/A
sin-lowering-sin.f64N/A
hypot-1-defN/A
hypot-lowering-hypot.f64N/A
associate-/l/N/A
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
tan-lowering-tan.f6499.8%
Applied egg-rr99.8%
Taylor expanded in eh around 0
*-lowering-*.f64N/A
sin-lowering-sin.f6472.9%
Simplified72.9%
Taylor expanded in t around 0
*-commutativeN/A
*-lowering-*.f6435.7%
Simplified35.7%
if -4.2e52 < ew < 8.9999999999999999e139Initial program 99.9%
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.f6453.5%
Simplified53.5%
sin-atanN/A
associate-/r*N/A
metadata-evalN/A
associate-/l/N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
hypot-undefineN/A
hypot-lowering-hypot.f64N/A
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
tan-lowering-tan.f64N/A
tan-lowering-tan.f6425.5%
Applied egg-rr25.5%
Taylor expanded in eh around inf
Simplified53.8%
if 8.9999999999999999e139 < ew Initial program 99.7%
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
cos-atanN/A
un-div-invN/A
/-lowering-/.f64N/A
sin-lowering-sin.f64N/A
hypot-1-defN/A
hypot-lowering-hypot.f64N/A
associate-/l/N/A
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
tan-lowering-tan.f6499.7%
Applied egg-rr99.7%
Taylor expanded in eh around 0
*-lowering-*.f64N/A
sin-lowering-sin.f6482.2%
Simplified82.2%
Taylor expanded in t around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6444.7%
Simplified44.7%
(FPCore (eh ew t)
:precision binary64
(if (<= ew -1.6e+52)
(fabs (* t ew))
(if (<= ew 2.8e+139)
(fabs eh)
(fabs
(*
ew
(*
t
(+
1.0
(*
(* t t)
(+ -0.16666666666666666 (* (* t t) 0.008333333333333333))))))))))
double code(double eh, double ew, double t) {
double tmp;
if (ew <= -1.6e+52) {
tmp = fabs((t * ew));
} else if (ew <= 2.8e+139) {
tmp = fabs(eh);
} else {
tmp = fabs((ew * (t * (1.0 + ((t * t) * (-0.16666666666666666 + ((t * t) * 0.008333333333333333)))))));
}
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.6d+52)) then
tmp = abs((t * ew))
else if (ew <= 2.8d+139) then
tmp = abs(eh)
else
tmp = abs((ew * (t * (1.0d0 + ((t * t) * ((-0.16666666666666666d0) + ((t * t) * 0.008333333333333333d0)))))))
end if
code = tmp
end function
public static double code(double eh, double ew, double t) {
double tmp;
if (ew <= -1.6e+52) {
tmp = Math.abs((t * ew));
} else if (ew <= 2.8e+139) {
tmp = Math.abs(eh);
} else {
tmp = Math.abs((ew * (t * (1.0 + ((t * t) * (-0.16666666666666666 + ((t * t) * 0.008333333333333333)))))));
}
return tmp;
}
def code(eh, ew, t): tmp = 0 if ew <= -1.6e+52: tmp = math.fabs((t * ew)) elif ew <= 2.8e+139: tmp = math.fabs(eh) else: tmp = math.fabs((ew * (t * (1.0 + ((t * t) * (-0.16666666666666666 + ((t * t) * 0.008333333333333333))))))) return tmp
function code(eh, ew, t) tmp = 0.0 if (ew <= -1.6e+52) tmp = abs(Float64(t * ew)); elseif (ew <= 2.8e+139) tmp = abs(eh); else tmp = abs(Float64(ew * Float64(t * Float64(1.0 + Float64(Float64(t * t) * Float64(-0.16666666666666666 + Float64(Float64(t * t) * 0.008333333333333333))))))); end return tmp end
function tmp_2 = code(eh, ew, t) tmp = 0.0; if (ew <= -1.6e+52) tmp = abs((t * ew)); elseif (ew <= 2.8e+139) tmp = abs(eh); else tmp = abs((ew * (t * (1.0 + ((t * t) * (-0.16666666666666666 + ((t * t) * 0.008333333333333333))))))); end tmp_2 = tmp; end
code[eh_, ew_, t_] := If[LessEqual[ew, -1.6e+52], N[Abs[N[(t * ew), $MachinePrecision]], $MachinePrecision], If[LessEqual[ew, 2.8e+139], N[Abs[eh], $MachinePrecision], N[Abs[N[(ew * N[(t * N[(1.0 + N[(N[(t * t), $MachinePrecision] * N[(-0.16666666666666666 + N[(N[(t * t), $MachinePrecision] * 0.008333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;ew \leq -1.6 \cdot 10^{+52}:\\
\;\;\;\;\left|t \cdot ew\right|\\
\mathbf{elif}\;ew \leq 2.8 \cdot 10^{+139}:\\
\;\;\;\;\left|eh\right|\\
\mathbf{else}:\\
\;\;\;\;\left|ew \cdot \left(t \cdot \left(1 + \left(t \cdot t\right) \cdot \left(-0.16666666666666666 + \left(t \cdot t\right) \cdot 0.008333333333333333\right)\right)\right)\right|\\
\end{array}
\end{array}
if ew < -1.6e52Initial program 99.8%
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
cos-atanN/A
un-div-invN/A
/-lowering-/.f64N/A
sin-lowering-sin.f64N/A
hypot-1-defN/A
hypot-lowering-hypot.f64N/A
associate-/l/N/A
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
tan-lowering-tan.f6499.8%
Applied egg-rr99.8%
Taylor expanded in eh around 0
*-lowering-*.f64N/A
sin-lowering-sin.f6472.9%
Simplified72.9%
Taylor expanded in t around 0
*-commutativeN/A
*-lowering-*.f6435.7%
Simplified35.7%
if -1.6e52 < ew < 2.7999999999999998e139Initial program 99.9%
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.f6453.5%
Simplified53.5%
sin-atanN/A
associate-/r*N/A
metadata-evalN/A
associate-/l/N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
hypot-undefineN/A
hypot-lowering-hypot.f64N/A
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
tan-lowering-tan.f64N/A
tan-lowering-tan.f6425.5%
Applied egg-rr25.5%
Taylor expanded in eh around inf
Simplified53.8%
if 2.7999999999999998e139 < ew Initial program 99.7%
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
cos-atanN/A
un-div-invN/A
/-lowering-/.f64N/A
sin-lowering-sin.f64N/A
hypot-1-defN/A
hypot-lowering-hypot.f64N/A
associate-/l/N/A
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
tan-lowering-tan.f6499.7%
Applied egg-rr99.7%
Taylor expanded in eh around 0
*-lowering-*.f64N/A
sin-lowering-sin.f6482.2%
Simplified82.2%
Taylor expanded in t around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6444.5%
Simplified44.5%
Final simplification48.7%
(FPCore (eh ew t)
:precision binary64
(if (<= ew -4e+52)
(fabs (* t ew))
(if (<= ew 5e+140)
(fabs eh)
(fabs (* t (+ ew (* -0.16666666666666666 (* ew (* t t)))))))))
double code(double eh, double ew, double t) {
double tmp;
if (ew <= -4e+52) {
tmp = fabs((t * ew));
} else if (ew <= 5e+140) {
tmp = fabs(eh);
} else {
tmp = fabs((t * (ew + (-0.16666666666666666 * (ew * (t * t))))));
}
return tmp;
}
real(8) function code(eh, ew, t)
real(8), intent (in) :: eh
real(8), intent (in) :: ew
real(8), intent (in) :: t
real(8) :: tmp
if (ew <= (-4d+52)) then
tmp = abs((t * ew))
else if (ew <= 5d+140) then
tmp = abs(eh)
else
tmp = abs((t * (ew + ((-0.16666666666666666d0) * (ew * (t * t))))))
end if
code = tmp
end function
public static double code(double eh, double ew, double t) {
double tmp;
if (ew <= -4e+52) {
tmp = Math.abs((t * ew));
} else if (ew <= 5e+140) {
tmp = Math.abs(eh);
} else {
tmp = Math.abs((t * (ew + (-0.16666666666666666 * (ew * (t * t))))));
}
return tmp;
}
def code(eh, ew, t): tmp = 0 if ew <= -4e+52: tmp = math.fabs((t * ew)) elif ew <= 5e+140: tmp = math.fabs(eh) else: tmp = math.fabs((t * (ew + (-0.16666666666666666 * (ew * (t * t)))))) return tmp
function code(eh, ew, t) tmp = 0.0 if (ew <= -4e+52) tmp = abs(Float64(t * ew)); elseif (ew <= 5e+140) tmp = abs(eh); else tmp = abs(Float64(t * Float64(ew + Float64(-0.16666666666666666 * Float64(ew * Float64(t * t)))))); end return tmp end
function tmp_2 = code(eh, ew, t) tmp = 0.0; if (ew <= -4e+52) tmp = abs((t * ew)); elseif (ew <= 5e+140) tmp = abs(eh); else tmp = abs((t * (ew + (-0.16666666666666666 * (ew * (t * t)))))); end tmp_2 = tmp; end
code[eh_, ew_, t_] := If[LessEqual[ew, -4e+52], N[Abs[N[(t * ew), $MachinePrecision]], $MachinePrecision], If[LessEqual[ew, 5e+140], N[Abs[eh], $MachinePrecision], N[Abs[N[(t * N[(ew + N[(-0.16666666666666666 * N[(ew * N[(t * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;ew \leq -4 \cdot 10^{+52}:\\
\;\;\;\;\left|t \cdot ew\right|\\
\mathbf{elif}\;ew \leq 5 \cdot 10^{+140}:\\
\;\;\;\;\left|eh\right|\\
\mathbf{else}:\\
\;\;\;\;\left|t \cdot \left(ew + -0.16666666666666666 \cdot \left(ew \cdot \left(t \cdot t\right)\right)\right)\right|\\
\end{array}
\end{array}
if ew < -4e52Initial program 99.8%
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
cos-atanN/A
un-div-invN/A
/-lowering-/.f64N/A
sin-lowering-sin.f64N/A
hypot-1-defN/A
hypot-lowering-hypot.f64N/A
associate-/l/N/A
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
tan-lowering-tan.f6499.8%
Applied egg-rr99.8%
Taylor expanded in eh around 0
*-lowering-*.f64N/A
sin-lowering-sin.f6472.9%
Simplified72.9%
Taylor expanded in t around 0
*-commutativeN/A
*-lowering-*.f6435.7%
Simplified35.7%
if -4e52 < ew < 5.00000000000000008e140Initial program 99.9%
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.f6453.5%
Simplified53.5%
sin-atanN/A
associate-/r*N/A
metadata-evalN/A
associate-/l/N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
hypot-undefineN/A
hypot-lowering-hypot.f64N/A
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
tan-lowering-tan.f64N/A
tan-lowering-tan.f6425.5%
Applied egg-rr25.5%
Taylor expanded in eh around inf
Simplified53.8%
if 5.00000000000000008e140 < ew Initial program 99.7%
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
cos-atanN/A
un-div-invN/A
/-lowering-/.f64N/A
sin-lowering-sin.f64N/A
hypot-1-defN/A
hypot-lowering-hypot.f64N/A
associate-/l/N/A
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
tan-lowering-tan.f6499.7%
Applied egg-rr99.7%
Taylor expanded in eh around 0
*-lowering-*.f64N/A
sin-lowering-sin.f6482.2%
Simplified82.2%
Taylor expanded in t around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6444.2%
Simplified44.2%
(FPCore (eh ew t) :precision binary64 (let* ((t_1 (fabs (* t ew)))) (if (<= ew -9e+48) t_1 (if (<= ew 2.3e+139) (fabs eh) t_1))))
double code(double eh, double ew, double t) {
double t_1 = fabs((t * ew));
double tmp;
if (ew <= -9e+48) {
tmp = t_1;
} else if (ew <= 2.3e+139) {
tmp = fabs(eh);
} 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((t * ew))
if (ew <= (-9d+48)) then
tmp = t_1
else if (ew <= 2.3d+139) then
tmp = abs(eh)
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((t * ew));
double tmp;
if (ew <= -9e+48) {
tmp = t_1;
} else if (ew <= 2.3e+139) {
tmp = Math.abs(eh);
} else {
tmp = t_1;
}
return tmp;
}
def code(eh, ew, t): t_1 = math.fabs((t * ew)) tmp = 0 if ew <= -9e+48: tmp = t_1 elif ew <= 2.3e+139: tmp = math.fabs(eh) else: tmp = t_1 return tmp
function code(eh, ew, t) t_1 = abs(Float64(t * ew)) tmp = 0.0 if (ew <= -9e+48) tmp = t_1; elseif (ew <= 2.3e+139) tmp = abs(eh); else tmp = t_1; end return tmp end
function tmp_2 = code(eh, ew, t) t_1 = abs((t * ew)); tmp = 0.0; if (ew <= -9e+48) tmp = t_1; elseif (ew <= 2.3e+139) tmp = abs(eh); else tmp = t_1; end tmp_2 = tmp; end
code[eh_, ew_, t_] := Block[{t$95$1 = N[Abs[N[(t * ew), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[ew, -9e+48], t$95$1, If[LessEqual[ew, 2.3e+139], N[Abs[eh], $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left|t \cdot ew\right|\\
\mathbf{if}\;ew \leq -9 \cdot 10^{+48}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;ew \leq 2.3 \cdot 10^{+139}:\\
\;\;\;\;\left|eh\right|\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if ew < -8.99999999999999991e48 or 2.3e139 < ew Initial program 99.8%
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
cos-atanN/A
un-div-invN/A
/-lowering-/.f64N/A
sin-lowering-sin.f64N/A
hypot-1-defN/A
hypot-lowering-hypot.f64N/A
associate-/l/N/A
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
tan-lowering-tan.f6499.8%
Applied egg-rr99.8%
Taylor expanded in eh around 0
*-lowering-*.f64N/A
sin-lowering-sin.f6476.8%
Simplified76.8%
Taylor expanded in t around 0
*-commutativeN/A
*-lowering-*.f6439.1%
Simplified39.1%
if -8.99999999999999991e48 < ew < 2.3e139Initial program 99.9%
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.f6453.5%
Simplified53.5%
sin-atanN/A
associate-/r*N/A
metadata-evalN/A
associate-/l/N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
hypot-undefineN/A
hypot-lowering-hypot.f64N/A
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
tan-lowering-tan.f64N/A
tan-lowering-tan.f6425.5%
Applied egg-rr25.5%
Taylor expanded in eh around inf
Simplified53.8%
(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.8%
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.f6441.4%
Simplified41.4%
sin-atanN/A
associate-/r*N/A
metadata-evalN/A
associate-/l/N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
hypot-undefineN/A
hypot-lowering-hypot.f64N/A
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
tan-lowering-tan.f64N/A
tan-lowering-tan.f6423.2%
Applied egg-rr23.2%
Taylor expanded in eh around inf
Simplified41.9%
herbie shell --seed 2024138
(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))))))))