
(FPCore (eh ew t) :precision binary64 (let* ((t_1 (atan (/ (* (- eh) (tan t)) ew)))) (fabs (- (* (* ew (cos t)) (cos t_1)) (* (* eh (sin t)) (sin t_1))))))
double code(double eh, double ew, double t) {
double t_1 = atan(((-eh * tan(t)) / ew));
return fabs((((ew * cos(t)) * cos(t_1)) - ((eh * sin(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 * tan(t)) / ew))
code = abs((((ew * cos(t)) * cos(t_1)) - ((eh * sin(t)) * sin(t_1))))
end function
public static double code(double eh, double ew, double t) {
double t_1 = Math.atan(((-eh * Math.tan(t)) / ew));
return Math.abs((((ew * Math.cos(t)) * Math.cos(t_1)) - ((eh * Math.sin(t)) * Math.sin(t_1))));
}
def code(eh, ew, t): t_1 = math.atan(((-eh * math.tan(t)) / ew)) return math.fabs((((ew * math.cos(t)) * math.cos(t_1)) - ((eh * math.sin(t)) * math.sin(t_1))))
function code(eh, ew, t) t_1 = atan(Float64(Float64(Float64(-eh) * tan(t)) / ew)) return abs(Float64(Float64(Float64(ew * cos(t)) * cos(t_1)) - Float64(Float64(eh * sin(t)) * sin(t_1)))) end
function tmp = code(eh, ew, t) t_1 = atan(((-eh * tan(t)) / ew)); tmp = abs((((ew * cos(t)) * cos(t_1)) - ((eh * sin(t)) * sin(t_1)))); end
code[eh_, ew_, t_] := Block[{t$95$1 = N[ArcTan[N[(N[((-eh) * N[Tan[t], $MachinePrecision]), $MachinePrecision] / ew), $MachinePrecision]], $MachinePrecision]}, N[Abs[N[(N[(N[(ew * N[Cos[t], $MachinePrecision]), $MachinePrecision] * N[Cos[t$95$1], $MachinePrecision]), $MachinePrecision] - N[(N[(eh * N[Sin[t], $MachinePrecision]), $MachinePrecision] * N[Sin[t$95$1], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\\
\left|\left(ew \cdot \cos t\right) \cdot \cos t\_1 - \left(eh \cdot \sin 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) (tan t)) ew)))) (fabs (- (* (* ew (cos t)) (cos t_1)) (* (* eh (sin t)) (sin t_1))))))
double code(double eh, double ew, double t) {
double t_1 = atan(((-eh * tan(t)) / ew));
return fabs((((ew * cos(t)) * cos(t_1)) - ((eh * sin(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 * tan(t)) / ew))
code = abs((((ew * cos(t)) * cos(t_1)) - ((eh * sin(t)) * sin(t_1))))
end function
public static double code(double eh, double ew, double t) {
double t_1 = Math.atan(((-eh * Math.tan(t)) / ew));
return Math.abs((((ew * Math.cos(t)) * Math.cos(t_1)) - ((eh * Math.sin(t)) * Math.sin(t_1))));
}
def code(eh, ew, t): t_1 = math.atan(((-eh * math.tan(t)) / ew)) return math.fabs((((ew * math.cos(t)) * math.cos(t_1)) - ((eh * math.sin(t)) * math.sin(t_1))))
function code(eh, ew, t) t_1 = atan(Float64(Float64(Float64(-eh) * tan(t)) / ew)) return abs(Float64(Float64(Float64(ew * cos(t)) * cos(t_1)) - Float64(Float64(eh * sin(t)) * sin(t_1)))) end
function tmp = code(eh, ew, t) t_1 = atan(((-eh * tan(t)) / ew)); tmp = abs((((ew * cos(t)) * cos(t_1)) - ((eh * sin(t)) * sin(t_1)))); end
code[eh_, ew_, t_] := Block[{t$95$1 = N[ArcTan[N[(N[((-eh) * N[Tan[t], $MachinePrecision]), $MachinePrecision] / ew), $MachinePrecision]], $MachinePrecision]}, N[Abs[N[(N[(N[(ew * N[Cos[t], $MachinePrecision]), $MachinePrecision] * N[Cos[t$95$1], $MachinePrecision]), $MachinePrecision] - N[(N[(eh * N[Sin[t], $MachinePrecision]), $MachinePrecision] * N[Sin[t$95$1], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\\
\left|\left(ew \cdot \cos t\right) \cdot \cos t\_1 - \left(eh \cdot \sin t\right) \cdot \sin t\_1\right|
\end{array}
\end{array}
(FPCore (eh ew t) :precision binary64 (let* ((t_1 (atan (* eh (/ (tan t) (- ew)))))) (fabs (fma ew (* (cos t_1) (- (cos t))) (* eh (* (sin t) (sin t_1)))))))
double code(double eh, double ew, double t) {
double t_1 = atan((eh * (tan(t) / -ew)));
return fabs(fma(ew, (cos(t_1) * -cos(t)), (eh * (sin(t) * sin(t_1)))));
}
function code(eh, ew, t) t_1 = atan(Float64(eh * Float64(tan(t) / Float64(-ew)))) return abs(fma(ew, Float64(cos(t_1) * Float64(-cos(t))), Float64(eh * Float64(sin(t) * sin(t_1))))) end
code[eh_, ew_, t_] := Block[{t$95$1 = N[ArcTan[N[(eh * N[(N[Tan[t], $MachinePrecision] / (-ew)), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, N[Abs[N[(ew * N[(N[Cos[t$95$1], $MachinePrecision] * (-N[Cos[t], $MachinePrecision])), $MachinePrecision] + N[(eh * N[(N[Sin[t], $MachinePrecision] * N[Sin[t$95$1], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \tan^{-1} \left(eh \cdot \frac{\tan t}{-ew}\right)\\
\left|\mathsf{fma}\left(ew, \cos t\_1 \cdot \left(-\cos t\right), eh \cdot \left(\sin t \cdot \sin t\_1\right)\right)\right|
\end{array}
\end{array}
Initial program 99.8%
fabs-sub99.8%
sub-neg99.8%
+-commutative99.8%
associate-*l*99.8%
distribute-rgt-neg-in99.8%
fma-define99.8%
Simplified99.8%
Final simplification99.8%
(FPCore (eh ew t) :precision binary64 (let* ((t_1 (atan (/ (* eh (- (tan t))) ew)))) (fabs (- (* (* ew (cos t)) (cos t_1)) (* (* eh (sin t)) (sin t_1))))))
double code(double eh, double ew, double t) {
double t_1 = atan(((eh * -tan(t)) / ew));
return fabs((((ew * cos(t)) * cos(t_1)) - ((eh * sin(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 * -tan(t)) / ew))
code = abs((((ew * cos(t)) * cos(t_1)) - ((eh * sin(t)) * sin(t_1))))
end function
public static double code(double eh, double ew, double t) {
double t_1 = Math.atan(((eh * -Math.tan(t)) / ew));
return Math.abs((((ew * Math.cos(t)) * Math.cos(t_1)) - ((eh * Math.sin(t)) * Math.sin(t_1))));
}
def code(eh, ew, t): t_1 = math.atan(((eh * -math.tan(t)) / ew)) return math.fabs((((ew * math.cos(t)) * math.cos(t_1)) - ((eh * math.sin(t)) * math.sin(t_1))))
function code(eh, ew, t) t_1 = atan(Float64(Float64(eh * Float64(-tan(t))) / ew)) return abs(Float64(Float64(Float64(ew * cos(t)) * cos(t_1)) - Float64(Float64(eh * sin(t)) * sin(t_1)))) end
function tmp = code(eh, ew, t) t_1 = atan(((eh * -tan(t)) / ew)); tmp = abs((((ew * cos(t)) * cos(t_1)) - ((eh * sin(t)) * sin(t_1)))); end
code[eh_, ew_, t_] := Block[{t$95$1 = N[ArcTan[N[(N[(eh * (-N[Tan[t], $MachinePrecision])), $MachinePrecision] / ew), $MachinePrecision]], $MachinePrecision]}, N[Abs[N[(N[(N[(ew * N[Cos[t], $MachinePrecision]), $MachinePrecision] * N[Cos[t$95$1], $MachinePrecision]), $MachinePrecision] - N[(N[(eh * N[Sin[t], $MachinePrecision]), $MachinePrecision] * N[Sin[t$95$1], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \tan^{-1} \left(\frac{eh \cdot \left(-\tan t\right)}{ew}\right)\\
\left|\left(ew \cdot \cos t\right) \cdot \cos t\_1 - \left(eh \cdot \sin t\right) \cdot \sin t\_1\right|
\end{array}
\end{array}
Initial program 99.8%
Final simplification99.8%
(FPCore (eh ew t)
:precision binary64
(if (or (<= ew -1.2e+25) (not (<= ew 1.5e-16)))
(fabs
(*
ew
(fma
(- (cos t))
(cos (atan (* eh (/ (tan t) (- ew)))))
(* eh (/ (sin t) ew)))))
(fabs
(*
eh
(-
(sin t)
(* ew (/ (* (cos t) (cos (atan (* (tan t) (/ eh (- ew)))))) eh)))))))
double code(double eh, double ew, double t) {
double tmp;
if ((ew <= -1.2e+25) || !(ew <= 1.5e-16)) {
tmp = fabs((ew * fma(-cos(t), cos(atan((eh * (tan(t) / -ew)))), (eh * (sin(t) / ew)))));
} else {
tmp = fabs((eh * (sin(t) - (ew * ((cos(t) * cos(atan((tan(t) * (eh / -ew))))) / eh)))));
}
return tmp;
}
function code(eh, ew, t) tmp = 0.0 if ((ew <= -1.2e+25) || !(ew <= 1.5e-16)) tmp = abs(Float64(ew * fma(Float64(-cos(t)), cos(atan(Float64(eh * Float64(tan(t) / Float64(-ew))))), Float64(eh * Float64(sin(t) / ew))))); else tmp = abs(Float64(eh * Float64(sin(t) - Float64(ew * Float64(Float64(cos(t) * cos(atan(Float64(tan(t) * Float64(eh / Float64(-ew)))))) / eh))))); end return tmp end
code[eh_, ew_, t_] := If[Or[LessEqual[ew, -1.2e+25], N[Not[LessEqual[ew, 1.5e-16]], $MachinePrecision]], N[Abs[N[(ew * N[((-N[Cos[t], $MachinePrecision]) * N[Cos[N[ArcTan[N[(eh * N[(N[Tan[t], $MachinePrecision] / (-ew)), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] + N[(eh * N[(N[Sin[t], $MachinePrecision] / ew), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Abs[N[(eh * N[(N[Sin[t], $MachinePrecision] - N[(ew * N[(N[(N[Cos[t], $MachinePrecision] * N[Cos[N[ArcTan[N[(N[Tan[t], $MachinePrecision] * N[(eh / (-ew)), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / eh), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;ew \leq -1.2 \cdot 10^{+25} \lor \neg \left(ew \leq 1.5 \cdot 10^{-16}\right):\\
\;\;\;\;\left|ew \cdot \mathsf{fma}\left(-\cos t, \cos \tan^{-1} \left(eh \cdot \frac{\tan t}{-ew}\right), eh \cdot \frac{\sin t}{ew}\right)\right|\\
\mathbf{else}:\\
\;\;\;\;\left|eh \cdot \left(\sin t - ew \cdot \frac{\cos t \cdot \cos \tan^{-1} \left(\tan t \cdot \frac{eh}{-ew}\right)}{eh}\right)\right|\\
\end{array}
\end{array}
if ew < -1.19999999999999998e25 or 1.49999999999999997e-16 < ew Initial program 99.8%
fabs-sub99.8%
sub-neg99.8%
+-commutative99.8%
associate-*l*99.8%
distribute-rgt-neg-in99.8%
fma-define99.8%
Simplified99.8%
sin-atan98.4%
associate-*r/98.4%
associate-*r/98.3%
*-commutative98.3%
associate-/l*98.3%
add-sqr-sqrt57.1%
sqrt-unprod80.1%
sqr-neg80.1%
sqrt-unprod40.8%
add-sqr-sqrt97.9%
hypot-1-def99.3%
associate-*r/99.3%
*-commutative99.3%
associate-/l*99.4%
Applied egg-rr99.4%
*-commutative99.4%
associate-*l*99.4%
associate-*r/99.3%
associate-*l/99.3%
*-commutative99.3%
Simplified99.3%
Taylor expanded in eh around inf 77.1%
mul-1-neg77.1%
unsub-neg77.1%
associate-/l*76.9%
Simplified76.9%
Taylor expanded in ew around inf 99.0%
associate-*r*99.0%
fma-define99.0%
mul-1-neg99.0%
mul-1-neg99.0%
associate-/l*99.0%
distribute-rgt-neg-in99.0%
associate-/l*99.0%
Simplified99.0%
if -1.19999999999999998e25 < ew < 1.49999999999999997e-16Initial program 99.7%
fabs-sub99.7%
sub-neg99.7%
+-commutative99.7%
associate-*l*99.7%
distribute-rgt-neg-in99.7%
fma-define99.7%
Simplified99.7%
sin-atan62.5%
associate-*r/62.5%
associate-*r/62.4%
*-commutative62.4%
associate-/l*59.1%
add-sqr-sqrt32.9%
sqrt-unprod52.4%
sqr-neg52.4%
sqrt-unprod26.0%
add-sqr-sqrt58.1%
hypot-1-def76.9%
associate-*r/76.9%
*-commutative76.9%
associate-/l*76.8%
Applied egg-rr76.8%
*-commutative76.8%
associate-*l*76.7%
associate-*r/76.8%
associate-*l/76.9%
*-commutative76.9%
Simplified76.9%
Taylor expanded in eh around inf 98.2%
mul-1-neg98.2%
unsub-neg98.2%
associate-/l*98.2%
Simplified98.2%
Final simplification98.6%
(FPCore (eh ew t)
:precision binary64
(if (or (<= ew -1.15e+76) (not (<= ew 2.4e+145)))
(fabs (* ew (cos t)))
(fabs
(*
eh
(-
(sin t)
(* ew (/ (* (cos t) (cos (atan (* (tan t) (/ eh (- ew)))))) eh)))))))
double code(double eh, double ew, double t) {
double tmp;
if ((ew <= -1.15e+76) || !(ew <= 2.4e+145)) {
tmp = fabs((ew * cos(t)));
} else {
tmp = fabs((eh * (sin(t) - (ew * ((cos(t) * cos(atan((tan(t) * (eh / -ew))))) / 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 ((ew <= (-1.15d+76)) .or. (.not. (ew <= 2.4d+145))) then
tmp = abs((ew * cos(t)))
else
tmp = abs((eh * (sin(t) - (ew * ((cos(t) * cos(atan((tan(t) * (eh / -ew))))) / eh)))))
end if
code = tmp
end function
public static double code(double eh, double ew, double t) {
double tmp;
if ((ew <= -1.15e+76) || !(ew <= 2.4e+145)) {
tmp = Math.abs((ew * Math.cos(t)));
} else {
tmp = Math.abs((eh * (Math.sin(t) - (ew * ((Math.cos(t) * Math.cos(Math.atan((Math.tan(t) * (eh / -ew))))) / eh)))));
}
return tmp;
}
def code(eh, ew, t): tmp = 0 if (ew <= -1.15e+76) or not (ew <= 2.4e+145): tmp = math.fabs((ew * math.cos(t))) else: tmp = math.fabs((eh * (math.sin(t) - (ew * ((math.cos(t) * math.cos(math.atan((math.tan(t) * (eh / -ew))))) / eh))))) return tmp
function code(eh, ew, t) tmp = 0.0 if ((ew <= -1.15e+76) || !(ew <= 2.4e+145)) tmp = abs(Float64(ew * cos(t))); else tmp = abs(Float64(eh * Float64(sin(t) - Float64(ew * Float64(Float64(cos(t) * cos(atan(Float64(tan(t) * Float64(eh / Float64(-ew)))))) / eh))))); end return tmp end
function tmp_2 = code(eh, ew, t) tmp = 0.0; if ((ew <= -1.15e+76) || ~((ew <= 2.4e+145))) tmp = abs((ew * cos(t))); else tmp = abs((eh * (sin(t) - (ew * ((cos(t) * cos(atan((tan(t) * (eh / -ew))))) / eh))))); end tmp_2 = tmp; end
code[eh_, ew_, t_] := If[Or[LessEqual[ew, -1.15e+76], N[Not[LessEqual[ew, 2.4e+145]], $MachinePrecision]], N[Abs[N[(ew * N[Cos[t], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Abs[N[(eh * N[(N[Sin[t], $MachinePrecision] - N[(ew * N[(N[(N[Cos[t], $MachinePrecision] * N[Cos[N[ArcTan[N[(N[Tan[t], $MachinePrecision] * N[(eh / (-ew)), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / eh), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;ew \leq -1.15 \cdot 10^{+76} \lor \neg \left(ew \leq 2.4 \cdot 10^{+145}\right):\\
\;\;\;\;\left|ew \cdot \cos t\right|\\
\mathbf{else}:\\
\;\;\;\;\left|eh \cdot \left(\sin t - ew \cdot \frac{\cos t \cdot \cos \tan^{-1} \left(\tan t \cdot \frac{eh}{-ew}\right)}{eh}\right)\right|\\
\end{array}
\end{array}
if ew < -1.15000000000000001e76 or 2.39999999999999992e145 < ew Initial program 99.8%
fabs-sub99.8%
sub-neg99.8%
+-commutative99.8%
associate-*l*99.8%
distribute-rgt-neg-in99.8%
fma-define99.8%
Simplified99.8%
add-cbrt-cube99.5%
pow399.5%
Applied egg-rr98.8%
Taylor expanded in ew around inf 96.0%
if -1.15000000000000001e76 < ew < 2.39999999999999992e145Initial program 99.8%
fabs-sub99.8%
sub-neg99.8%
+-commutative99.8%
associate-*l*99.8%
distribute-rgt-neg-in99.8%
fma-define99.8%
Simplified99.8%
sin-atan71.6%
associate-*r/71.5%
associate-*r/71.5%
*-commutative71.5%
associate-/l*69.0%
add-sqr-sqrt39.3%
sqrt-unprod60.2%
sqr-neg60.2%
sqrt-unprod29.5%
add-sqr-sqrt68.3%
hypot-1-def83.1%
associate-*r/83.1%
*-commutative83.1%
associate-/l*83.0%
Applied egg-rr83.0%
*-commutative83.0%
associate-*l*83.0%
associate-*r/83.1%
associate-*l/83.1%
*-commutative83.1%
Simplified83.1%
Taylor expanded in eh around inf 96.7%
mul-1-neg96.7%
unsub-neg96.7%
associate-/l*96.6%
Simplified96.6%
Final simplification96.4%
(FPCore (eh ew t)
:precision binary64
(let* ((t_1 (fabs (* ew (cos t)))))
(if (<= ew -3.7e+62)
t_1
(if (<= ew -6e-157)
(-
(* (cos t) (- ew))
(* eh (* (sin t) (sin (atan (* eh (/ (tan t) ew)))))))
(if (<= ew 5.5e-97) (fabs (* eh (sin t))) t_1)))))
double code(double eh, double ew, double t) {
double t_1 = fabs((ew * cos(t)));
double tmp;
if (ew <= -3.7e+62) {
tmp = t_1;
} else if (ew <= -6e-157) {
tmp = (cos(t) * -ew) - (eh * (sin(t) * sin(atan((eh * (tan(t) / ew))))));
} else if (ew <= 5.5e-97) {
tmp = fabs((eh * 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((ew * cos(t)))
if (ew <= (-3.7d+62)) then
tmp = t_1
else if (ew <= (-6d-157)) then
tmp = (cos(t) * -ew) - (eh * (sin(t) * sin(atan((eh * (tan(t) / ew))))))
else if (ew <= 5.5d-97) then
tmp = abs((eh * 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((ew * Math.cos(t)));
double tmp;
if (ew <= -3.7e+62) {
tmp = t_1;
} else if (ew <= -6e-157) {
tmp = (Math.cos(t) * -ew) - (eh * (Math.sin(t) * Math.sin(Math.atan((eh * (Math.tan(t) / ew))))));
} else if (ew <= 5.5e-97) {
tmp = Math.abs((eh * Math.sin(t)));
} else {
tmp = t_1;
}
return tmp;
}
def code(eh, ew, t): t_1 = math.fabs((ew * math.cos(t))) tmp = 0 if ew <= -3.7e+62: tmp = t_1 elif ew <= -6e-157: tmp = (math.cos(t) * -ew) - (eh * (math.sin(t) * math.sin(math.atan((eh * (math.tan(t) / ew)))))) elif ew <= 5.5e-97: tmp = math.fabs((eh * math.sin(t))) else: tmp = t_1 return tmp
function code(eh, ew, t) t_1 = abs(Float64(ew * cos(t))) tmp = 0.0 if (ew <= -3.7e+62) tmp = t_1; elseif (ew <= -6e-157) tmp = Float64(Float64(cos(t) * Float64(-ew)) - Float64(eh * Float64(sin(t) * sin(atan(Float64(eh * Float64(tan(t) / ew))))))); elseif (ew <= 5.5e-97) tmp = abs(Float64(eh * sin(t))); else tmp = t_1; end return tmp end
function tmp_2 = code(eh, ew, t) t_1 = abs((ew * cos(t))); tmp = 0.0; if (ew <= -3.7e+62) tmp = t_1; elseif (ew <= -6e-157) tmp = (cos(t) * -ew) - (eh * (sin(t) * sin(atan((eh * (tan(t) / ew)))))); elseif (ew <= 5.5e-97) tmp = abs((eh * sin(t))); else tmp = t_1; end tmp_2 = tmp; end
code[eh_, ew_, t_] := Block[{t$95$1 = N[Abs[N[(ew * N[Cos[t], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[ew, -3.7e+62], t$95$1, If[LessEqual[ew, -6e-157], N[(N[(N[Cos[t], $MachinePrecision] * (-ew)), $MachinePrecision] - N[(eh * N[(N[Sin[t], $MachinePrecision] * N[Sin[N[ArcTan[N[(eh * N[(N[Tan[t], $MachinePrecision] / ew), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[ew, 5.5e-97], N[Abs[N[(eh * N[Sin[t], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left|ew \cdot \cos t\right|\\
\mathbf{if}\;ew \leq -3.7 \cdot 10^{+62}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;ew \leq -6 \cdot 10^{-157}:\\
\;\;\;\;\cos t \cdot \left(-ew\right) - eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(eh \cdot \frac{\tan t}{ew}\right)\right)\\
\mathbf{elif}\;ew \leq 5.5 \cdot 10^{-97}:\\
\;\;\;\;\left|eh \cdot \sin t\right|\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if ew < -3.70000000000000014e62 or 5.49999999999999948e-97 < ew Initial program 99.8%
fabs-sub99.8%
sub-neg99.8%
+-commutative99.8%
associate-*l*99.8%
distribute-rgt-neg-in99.8%
fma-define99.8%
Simplified99.8%
add-cbrt-cube99.6%
pow399.6%
Applied egg-rr98.8%
Taylor expanded in ew around inf 87.5%
if -3.70000000000000014e62 < ew < -6e-157Initial program 99.7%
Applied egg-rr82.4%
Taylor expanded in eh around 0 82.4%
mul-1-neg82.4%
*-commutative82.4%
distribute-lft-neg-in82.4%
mul-1-neg82.4%
associate-*r*82.4%
mul-1-neg82.4%
associate-*r/82.4%
Simplified82.4%
if -6e-157 < ew < 5.49999999999999948e-97Initial program 99.8%
fabs-sub99.8%
sub-neg99.8%
+-commutative99.8%
associate-*l*99.8%
distribute-rgt-neg-in99.8%
fma-define99.8%
Simplified99.8%
sin-atan56.1%
associate-*r/56.1%
associate-*r/56.0%
*-commutative56.0%
associate-/l*51.3%
add-sqr-sqrt30.1%
sqrt-unprod41.1%
sqr-neg41.1%
sqrt-unprod20.8%
add-sqr-sqrt50.1%
hypot-1-def67.4%
associate-*r/67.4%
*-commutative67.4%
associate-/l*67.2%
Applied egg-rr67.2%
*-commutative67.2%
associate-*l*67.1%
associate-*r/67.3%
associate-*l/67.4%
*-commutative67.4%
Simplified67.4%
Taylor expanded in ew around 0 79.1%
Final simplification84.3%
(FPCore (eh ew t) :precision binary64 (if (or (<= ew -1.3e-123) (not (<= ew 5e-99))) (fabs (* ew (cos t))) (fabs (* eh (sin t)))))
double code(double eh, double ew, double t) {
double tmp;
if ((ew <= -1.3e-123) || !(ew <= 5e-99)) {
tmp = fabs((ew * cos(t)));
} else {
tmp = fabs((eh * sin(t)));
}
return tmp;
}
real(8) function code(eh, ew, t)
real(8), intent (in) :: eh
real(8), intent (in) :: ew
real(8), intent (in) :: t
real(8) :: tmp
if ((ew <= (-1.3d-123)) .or. (.not. (ew <= 5d-99))) then
tmp = abs((ew * cos(t)))
else
tmp = abs((eh * sin(t)))
end if
code = tmp
end function
public static double code(double eh, double ew, double t) {
double tmp;
if ((ew <= -1.3e-123) || !(ew <= 5e-99)) {
tmp = Math.abs((ew * Math.cos(t)));
} else {
tmp = Math.abs((eh * Math.sin(t)));
}
return tmp;
}
def code(eh, ew, t): tmp = 0 if (ew <= -1.3e-123) or not (ew <= 5e-99): tmp = math.fabs((ew * math.cos(t))) else: tmp = math.fabs((eh * math.sin(t))) return tmp
function code(eh, ew, t) tmp = 0.0 if ((ew <= -1.3e-123) || !(ew <= 5e-99)) tmp = abs(Float64(ew * cos(t))); else tmp = abs(Float64(eh * sin(t))); end return tmp end
function tmp_2 = code(eh, ew, t) tmp = 0.0; if ((ew <= -1.3e-123) || ~((ew <= 5e-99))) tmp = abs((ew * cos(t))); else tmp = abs((eh * sin(t))); end tmp_2 = tmp; end
code[eh_, ew_, t_] := If[Or[LessEqual[ew, -1.3e-123], N[Not[LessEqual[ew, 5e-99]], $MachinePrecision]], N[Abs[N[(ew * N[Cos[t], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Abs[N[(eh * N[Sin[t], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;ew \leq -1.3 \cdot 10^{-123} \lor \neg \left(ew \leq 5 \cdot 10^{-99}\right):\\
\;\;\;\;\left|ew \cdot \cos t\right|\\
\mathbf{else}:\\
\;\;\;\;\left|eh \cdot \sin t\right|\\
\end{array}
\end{array}
if ew < -1.29999999999999998e-123 or 4.99999999999999969e-99 < ew Initial program 99.8%
fabs-sub99.8%
sub-neg99.8%
+-commutative99.8%
associate-*l*99.8%
distribute-rgt-neg-in99.8%
fma-define99.8%
Simplified99.8%
add-cbrt-cube99.6%
pow399.6%
Applied egg-rr99.0%
Taylor expanded in ew around inf 81.4%
if -1.29999999999999998e-123 < ew < 4.99999999999999969e-99Initial program 99.8%
fabs-sub99.8%
sub-neg99.8%
+-commutative99.8%
associate-*l*99.8%
distribute-rgt-neg-in99.8%
fma-define99.8%
Simplified99.8%
sin-atan55.8%
associate-*r/55.8%
associate-*r/55.7%
*-commutative55.7%
associate-/l*51.3%
add-sqr-sqrt31.2%
sqrt-unprod41.6%
sqr-neg41.6%
sqrt-unprod19.7%
add-sqr-sqrt50.1%
hypot-1-def66.5%
associate-*r/66.5%
*-commutative66.5%
associate-/l*66.2%
Applied egg-rr66.2%
*-commutative66.2%
associate-*l*66.1%
associate-*r/66.4%
associate-*l/66.5%
*-commutative66.5%
Simplified66.5%
Taylor expanded in ew around 0 79.0%
Final simplification80.7%
(FPCore (eh ew t) :precision binary64 (if (<= ew -4.8e+24) (* (cos t) (- ew)) (if (<= ew 7.2e+37) (fabs (* eh (sin t))) (fabs ew))))
double code(double eh, double ew, double t) {
double tmp;
if (ew <= -4.8e+24) {
tmp = cos(t) * -ew;
} else if (ew <= 7.2e+37) {
tmp = fabs((eh * sin(t)));
} else {
tmp = fabs(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 (ew <= (-4.8d+24)) then
tmp = cos(t) * -ew
else if (ew <= 7.2d+37) then
tmp = abs((eh * sin(t)))
else
tmp = abs(ew)
end if
code = tmp
end function
public static double code(double eh, double ew, double t) {
double tmp;
if (ew <= -4.8e+24) {
tmp = Math.cos(t) * -ew;
} else if (ew <= 7.2e+37) {
tmp = Math.abs((eh * Math.sin(t)));
} else {
tmp = Math.abs(ew);
}
return tmp;
}
def code(eh, ew, t): tmp = 0 if ew <= -4.8e+24: tmp = math.cos(t) * -ew elif ew <= 7.2e+37: tmp = math.fabs((eh * math.sin(t))) else: tmp = math.fabs(ew) return tmp
function code(eh, ew, t) tmp = 0.0 if (ew <= -4.8e+24) tmp = Float64(cos(t) * Float64(-ew)); elseif (ew <= 7.2e+37) tmp = abs(Float64(eh * sin(t))); else tmp = abs(ew); end return tmp end
function tmp_2 = code(eh, ew, t) tmp = 0.0; if (ew <= -4.8e+24) tmp = cos(t) * -ew; elseif (ew <= 7.2e+37) tmp = abs((eh * sin(t))); else tmp = abs(ew); end tmp_2 = tmp; end
code[eh_, ew_, t_] := If[LessEqual[ew, -4.8e+24], N[(N[Cos[t], $MachinePrecision] * (-ew)), $MachinePrecision], If[LessEqual[ew, 7.2e+37], N[Abs[N[(eh * N[Sin[t], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Abs[ew], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;ew \leq -4.8 \cdot 10^{+24}:\\
\;\;\;\;\cos t \cdot \left(-ew\right)\\
\mathbf{elif}\;ew \leq 7.2 \cdot 10^{+37}:\\
\;\;\;\;\left|eh \cdot \sin t\right|\\
\mathbf{else}:\\
\;\;\;\;\left|ew\right|\\
\end{array}
\end{array}
if ew < -4.8000000000000001e24Initial program 99.8%
Applied egg-rr69.5%
Taylor expanded in eh around 0 62.5%
associate-*r*62.5%
neg-mul-162.5%
Simplified62.5%
if -4.8000000000000001e24 < ew < 7.19999999999999995e37Initial program 99.7%
fabs-sub99.7%
sub-neg99.7%
+-commutative99.7%
associate-*l*99.7%
distribute-rgt-neg-in99.7%
fma-define99.7%
Simplified99.7%
sin-atan64.1%
associate-*r/64.0%
associate-*r/64.0%
*-commutative64.0%
associate-/l*60.9%
add-sqr-sqrt33.2%
sqrt-unprod53.1%
sqr-neg53.1%
sqrt-unprod27.4%
add-sqr-sqrt59.9%
hypot-1-def78.3%
associate-*r/78.3%
*-commutative78.3%
associate-/l*78.1%
Applied egg-rr78.1%
*-commutative78.1%
associate-*l*78.1%
associate-*r/78.2%
associate-*l/78.3%
*-commutative78.3%
Simplified78.3%
Taylor expanded in ew around 0 64.0%
if 7.19999999999999995e37 < ew Initial program 99.9%
fabs-sub99.9%
sub-neg99.9%
+-commutative99.9%
associate-*l*99.9%
distribute-rgt-neg-in99.9%
fma-define99.9%
Simplified99.9%
add-cbrt-cube99.7%
pow399.8%
Applied egg-rr99.8%
Taylor expanded in t around 0 71.6%
Final simplification65.5%
(FPCore (eh ew t) :precision binary64 (if (<= ew -1.85e-128) (* (cos t) (- ew)) (if (<= ew 4.1e-96) (* eh (- (sin t))) (fabs ew))))
double code(double eh, double ew, double t) {
double tmp;
if (ew <= -1.85e-128) {
tmp = cos(t) * -ew;
} else if (ew <= 4.1e-96) {
tmp = eh * -sin(t);
} else {
tmp = fabs(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 (ew <= (-1.85d-128)) then
tmp = cos(t) * -ew
else if (ew <= 4.1d-96) then
tmp = eh * -sin(t)
else
tmp = abs(ew)
end if
code = tmp
end function
public static double code(double eh, double ew, double t) {
double tmp;
if (ew <= -1.85e-128) {
tmp = Math.cos(t) * -ew;
} else if (ew <= 4.1e-96) {
tmp = eh * -Math.sin(t);
} else {
tmp = Math.abs(ew);
}
return tmp;
}
def code(eh, ew, t): tmp = 0 if ew <= -1.85e-128: tmp = math.cos(t) * -ew elif ew <= 4.1e-96: tmp = eh * -math.sin(t) else: tmp = math.fabs(ew) return tmp
function code(eh, ew, t) tmp = 0.0 if (ew <= -1.85e-128) tmp = Float64(cos(t) * Float64(-ew)); elseif (ew <= 4.1e-96) tmp = Float64(eh * Float64(-sin(t))); else tmp = abs(ew); end return tmp end
function tmp_2 = code(eh, ew, t) tmp = 0.0; if (ew <= -1.85e-128) tmp = cos(t) * -ew; elseif (ew <= 4.1e-96) tmp = eh * -sin(t); else tmp = abs(ew); end tmp_2 = tmp; end
code[eh_, ew_, t_] := If[LessEqual[ew, -1.85e-128], N[(N[Cos[t], $MachinePrecision] * (-ew)), $MachinePrecision], If[LessEqual[ew, 4.1e-96], N[(eh * (-N[Sin[t], $MachinePrecision])), $MachinePrecision], N[Abs[ew], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;ew \leq -1.85 \cdot 10^{-128}:\\
\;\;\;\;\cos t \cdot \left(-ew\right)\\
\mathbf{elif}\;ew \leq 4.1 \cdot 10^{-96}:\\
\;\;\;\;eh \cdot \left(-\sin t\right)\\
\mathbf{else}:\\
\;\;\;\;\left|ew\right|\\
\end{array}
\end{array}
if ew < -1.85e-128Initial program 99.7%
Applied egg-rr73.3%
Taylor expanded in eh around 0 56.2%
associate-*r*56.2%
neg-mul-156.2%
Simplified56.2%
if -1.85e-128 < ew < 4.10000000000000024e-96Initial program 99.8%
fabs-sub99.8%
sub-neg99.8%
+-commutative99.8%
associate-*l*99.8%
distribute-rgt-neg-in99.8%
fma-define99.8%
Simplified99.8%
sin-atan55.2%
associate-*r/55.1%
associate-*r/55.1%
*-commutative55.1%
associate-/l*50.6%
add-sqr-sqrt30.2%
sqrt-unprod40.7%
sqr-neg40.7%
sqrt-unprod19.9%
add-sqr-sqrt49.3%
hypot-1-def66.0%
associate-*r/66.0%
*-commutative66.0%
associate-/l*65.7%
Applied egg-rr65.7%
*-commutative65.7%
associate-*l*65.6%
associate-*r/65.9%
associate-*l/66.0%
*-commutative66.0%
Simplified66.0%
*-un-lft-identity66.0%
distribute-lft-neg-out66.0%
atan-neg66.0%
*-commutative66.0%
Applied egg-rr66.0%
*-lft-identity66.0%
rem-square-sqrt36.1%
Simplified26.3%
Taylor expanded in eh around -inf 49.2%
mul-1-neg49.2%
*-commutative49.2%
distribute-rgt-neg-in49.2%
Simplified49.2%
if 4.10000000000000024e-96 < ew Initial program 99.8%
fabs-sub99.8%
sub-neg99.8%
+-commutative99.8%
associate-*l*99.8%
distribute-rgt-neg-in99.8%
fma-define99.8%
Simplified99.8%
add-cbrt-cube99.7%
pow399.7%
Applied egg-rr99.2%
Taylor expanded in t around 0 60.6%
Final simplification55.8%
(FPCore (eh ew t) :precision binary64 (if (or (<= t -2e-14) (not (<= t 7.8e-22))) (* eh (sin t)) (fabs ew)))
double code(double eh, double ew, double t) {
double tmp;
if ((t <= -2e-14) || !(t <= 7.8e-22)) {
tmp = eh * sin(t);
} else {
tmp = fabs(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 ((t <= (-2d-14)) .or. (.not. (t <= 7.8d-22))) then
tmp = eh * sin(t)
else
tmp = abs(ew)
end if
code = tmp
end function
public static double code(double eh, double ew, double t) {
double tmp;
if ((t <= -2e-14) || !(t <= 7.8e-22)) {
tmp = eh * Math.sin(t);
} else {
tmp = Math.abs(ew);
}
return tmp;
}
def code(eh, ew, t): tmp = 0 if (t <= -2e-14) or not (t <= 7.8e-22): tmp = eh * math.sin(t) else: tmp = math.fabs(ew) return tmp
function code(eh, ew, t) tmp = 0.0 if ((t <= -2e-14) || !(t <= 7.8e-22)) tmp = Float64(eh * sin(t)); else tmp = abs(ew); end return tmp end
function tmp_2 = code(eh, ew, t) tmp = 0.0; if ((t <= -2e-14) || ~((t <= 7.8e-22))) tmp = eh * sin(t); else tmp = abs(ew); end tmp_2 = tmp; end
code[eh_, ew_, t_] := If[Or[LessEqual[t, -2e-14], N[Not[LessEqual[t, 7.8e-22]], $MachinePrecision]], N[(eh * N[Sin[t], $MachinePrecision]), $MachinePrecision], N[Abs[ew], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2 \cdot 10^{-14} \lor \neg \left(t \leq 7.8 \cdot 10^{-22}\right):\\
\;\;\;\;eh \cdot \sin t\\
\mathbf{else}:\\
\;\;\;\;\left|ew\right|\\
\end{array}
\end{array}
if t < -2e-14 or 7.79999999999999996e-22 < t Initial program 99.6%
fabs-sub99.6%
sub-neg99.6%
+-commutative99.6%
associate-*l*99.6%
distribute-rgt-neg-in99.6%
fma-define99.6%
Simplified99.6%
sin-atan72.4%
associate-*r/72.4%
associate-*r/72.3%
*-commutative72.3%
associate-/l*72.3%
add-sqr-sqrt42.1%
sqrt-unprod61.2%
sqr-neg61.2%
sqrt-unprod30.2%
add-sqr-sqrt71.9%
hypot-1-def88.1%
associate-*r/88.1%
*-commutative88.1%
associate-/l*88.2%
Applied egg-rr88.2%
*-commutative88.2%
associate-*l*88.1%
associate-*r/88.0%
associate-*l/88.0%
*-commutative88.0%
Simplified88.0%
*-un-lft-identity88.0%
distribute-lft-neg-out88.0%
atan-neg88.0%
*-commutative88.0%
Applied egg-rr88.0%
*-lft-identity88.0%
rem-square-sqrt38.2%
Simplified31.4%
Taylor expanded in ew around 0 24.5%
if -2e-14 < t < 7.79999999999999996e-22Initial program 100.0%
fabs-sub100.0%
sub-neg100.0%
+-commutative100.0%
associate-*l*100.0%
distribute-rgt-neg-in100.0%
fma-define100.0%
Simplified100.0%
add-cbrt-cube100.0%
pow3100.0%
Applied egg-rr98.9%
Taylor expanded in t around 0 80.0%
Final simplification50.5%
(FPCore (eh ew t) :precision binary64 (if (<= ew -1.45e-266) (* (cos t) (- ew)) (if (<= ew 4.9e-95) (* eh (sin t)) (fabs ew))))
double code(double eh, double ew, double t) {
double tmp;
if (ew <= -1.45e-266) {
tmp = cos(t) * -ew;
} else if (ew <= 4.9e-95) {
tmp = eh * sin(t);
} else {
tmp = fabs(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 (ew <= (-1.45d-266)) then
tmp = cos(t) * -ew
else if (ew <= 4.9d-95) then
tmp = eh * sin(t)
else
tmp = abs(ew)
end if
code = tmp
end function
public static double code(double eh, double ew, double t) {
double tmp;
if (ew <= -1.45e-266) {
tmp = Math.cos(t) * -ew;
} else if (ew <= 4.9e-95) {
tmp = eh * Math.sin(t);
} else {
tmp = Math.abs(ew);
}
return tmp;
}
def code(eh, ew, t): tmp = 0 if ew <= -1.45e-266: tmp = math.cos(t) * -ew elif ew <= 4.9e-95: tmp = eh * math.sin(t) else: tmp = math.fabs(ew) return tmp
function code(eh, ew, t) tmp = 0.0 if (ew <= -1.45e-266) tmp = Float64(cos(t) * Float64(-ew)); elseif (ew <= 4.9e-95) tmp = Float64(eh * sin(t)); else tmp = abs(ew); end return tmp end
function tmp_2 = code(eh, ew, t) tmp = 0.0; if (ew <= -1.45e-266) tmp = cos(t) * -ew; elseif (ew <= 4.9e-95) tmp = eh * sin(t); else tmp = abs(ew); end tmp_2 = tmp; end
code[eh_, ew_, t_] := If[LessEqual[ew, -1.45e-266], N[(N[Cos[t], $MachinePrecision] * (-ew)), $MachinePrecision], If[LessEqual[ew, 4.9e-95], N[(eh * N[Sin[t], $MachinePrecision]), $MachinePrecision], N[Abs[ew], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;ew \leq -1.45 \cdot 10^{-266}:\\
\;\;\;\;\cos t \cdot \left(-ew\right)\\
\mathbf{elif}\;ew \leq 4.9 \cdot 10^{-95}:\\
\;\;\;\;eh \cdot \sin t\\
\mathbf{else}:\\
\;\;\;\;\left|ew\right|\\
\end{array}
\end{array}
if ew < -1.44999999999999998e-266Initial program 99.7%
Applied egg-rr74.3%
Taylor expanded in eh around 0 50.9%
associate-*r*50.9%
neg-mul-150.9%
Simplified50.9%
if -1.44999999999999998e-266 < ew < 4.9e-95Initial program 99.8%
fabs-sub99.8%
sub-neg99.8%
+-commutative99.8%
associate-*l*99.8%
distribute-rgt-neg-in99.8%
fma-define99.8%
Simplified99.8%
sin-atan59.8%
associate-*r/59.8%
associate-*r/59.7%
*-commutative59.7%
associate-/l*55.6%
add-sqr-sqrt32.8%
sqrt-unprod45.4%
sqr-neg45.4%
sqrt-unprod22.2%
add-sqr-sqrt53.9%
hypot-1-def69.6%
associate-*r/69.6%
*-commutative69.6%
associate-/l*69.5%
Applied egg-rr69.5%
*-commutative69.5%
associate-*l*69.3%
associate-*r/69.4%
associate-*l/69.5%
*-commutative69.5%
Simplified69.5%
*-un-lft-identity69.5%
distribute-lft-neg-out69.5%
atan-neg69.5%
*-commutative69.5%
Applied egg-rr69.5%
*-lft-identity69.5%
rem-square-sqrt29.4%
Simplified19.0%
Taylor expanded in ew around 0 40.6%
if 4.9e-95 < ew Initial program 99.9%
fabs-sub99.9%
sub-neg99.9%
+-commutative99.9%
associate-*l*99.9%
distribute-rgt-neg-in99.9%
fma-define99.9%
Simplified99.9%
add-cbrt-cube99.7%
pow399.7%
Applied egg-rr99.3%
Taylor expanded in t around 0 61.6%
Final simplification52.6%
(FPCore (eh ew t) :precision binary64 (fabs ew))
double code(double eh, double ew, double t) {
return fabs(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(ew)
end function
public static double code(double eh, double ew, double t) {
return Math.abs(ew);
}
def code(eh, ew, t): return math.fabs(ew)
function code(eh, ew, t) return abs(ew) end
function tmp = code(eh, ew, t) tmp = abs(ew); end
code[eh_, ew_, t_] := N[Abs[ew], $MachinePrecision]
\begin{array}{l}
\\
\left|ew\right|
\end{array}
Initial program 99.8%
fabs-sub99.8%
sub-neg99.8%
+-commutative99.8%
associate-*l*99.8%
distribute-rgt-neg-in99.8%
fma-define99.8%
Simplified99.8%
add-cbrt-cube99.6%
pow399.6%
Applied egg-rr98.9%
Taylor expanded in t around 0 45.1%
(FPCore (eh ew t) :precision binary64 (- ew))
double code(double eh, double ew, double t) {
return -ew;
}
real(8) function code(eh, ew, t)
real(8), intent (in) :: eh
real(8), intent (in) :: ew
real(8), intent (in) :: t
code = -ew
end function
public static double code(double eh, double ew, double t) {
return -ew;
}
def code(eh, ew, t): return -ew
function code(eh, ew, t) return Float64(-ew) end
function tmp = code(eh, ew, t) tmp = -ew; end
code[eh_, ew_, t_] := (-ew)
\begin{array}{l}
\\
-ew
\end{array}
Initial program 99.8%
Applied egg-rr48.2%
Taylor expanded in t around 0 21.3%
neg-mul-121.3%
Simplified21.3%
herbie shell --seed 2024139
(FPCore (eh ew t)
:name "Example 2 from Robby"
:precision binary64
(fabs (- (* (* ew (cos t)) (cos (atan (/ (* (- eh) (tan t)) ew)))) (* (* eh (sin t)) (sin (atan (/ (* (- eh) (tan t)) ew)))))))