
(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 16 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(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}
Initial program 99.8%
(FPCore (eh ew t) :precision binary64 (fabs (- (/ 1.0 (/ (hypot 1.0 (* (tan t) (/ eh ew))) (* ew (cos t)))) (* (* eh (sin t)) (sin (atan (/ (* (- eh) (tan t)) ew)))))))
double code(double eh, double ew, double t) {
return fabs(((1.0 / (hypot(1.0, (tan(t) * (eh / ew))) / (ew * cos(t)))) - ((eh * sin(t)) * sin(atan(((-eh * tan(t)) / ew))))));
}
public static double code(double eh, double ew, double t) {
return Math.abs(((1.0 / (Math.hypot(1.0, (Math.tan(t) * (eh / ew))) / (ew * Math.cos(t)))) - ((eh * Math.sin(t)) * Math.sin(Math.atan(((-eh * Math.tan(t)) / ew))))));
}
def code(eh, ew, t): return math.fabs(((1.0 / (math.hypot(1.0, (math.tan(t) * (eh / ew))) / (ew * math.cos(t)))) - ((eh * math.sin(t)) * math.sin(math.atan(((-eh * math.tan(t)) / ew))))))
function code(eh, ew, t) return abs(Float64(Float64(1.0 / Float64(hypot(1.0, Float64(tan(t) * Float64(eh / ew))) / Float64(ew * cos(t)))) - Float64(Float64(eh * sin(t)) * sin(atan(Float64(Float64(Float64(-eh) * tan(t)) / ew)))))) end
function tmp = code(eh, ew, t) tmp = abs(((1.0 / (hypot(1.0, (tan(t) * (eh / ew))) / (ew * cos(t)))) - ((eh * sin(t)) * sin(atan(((-eh * tan(t)) / ew)))))); end
code[eh_, ew_, t_] := N[Abs[N[(N[(1.0 / N[(N[Sqrt[1.0 ^ 2 + N[(N[Tan[t], $MachinePrecision] * N[(eh / ew), $MachinePrecision]), $MachinePrecision] ^ 2], $MachinePrecision] / N[(ew * N[Cos[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(eh * N[Sin[t], $MachinePrecision]), $MachinePrecision] * N[Sin[N[ArcTan[N[(N[((-eh) * N[Tan[t], $MachinePrecision]), $MachinePrecision] / ew), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\left|\frac{1}{\frac{\mathsf{hypot}\left(1, \tan t \cdot \frac{eh}{ew}\right)}{ew \cdot \cos t}} - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right|
\end{array}
Initial program 99.8%
add-cube-cbrt98.6%
pow398.6%
Applied egg-rr98.6%
rem-cube-cbrt99.8%
clear-num99.6%
Applied egg-rr99.6%
(FPCore (eh ew t)
:precision binary64
(if (or (<= ew -3.8e-60) (not (<= ew 1.2e-119)))
(fabs
(*
ew
(-
(cos t)
(/ (* (* eh (sin t)) (sin (atan (* (tan t) (/ eh (- ew)))))) ew))))
(fabs
(*
eh
(-
(* ew (/ (cos t) eh))
(* (sin t) (sin (atan (* eh (/ (tan t) (- ew)))))))))))
double code(double eh, double ew, double t) {
double tmp;
if ((ew <= -3.8e-60) || !(ew <= 1.2e-119)) {
tmp = fabs((ew * (cos(t) - (((eh * sin(t)) * sin(atan((tan(t) * (eh / -ew))))) / ew))));
} else {
tmp = fabs((eh * ((ew * (cos(t) / eh)) - (sin(t) * sin(atan((eh * (tan(t) / -ew))))))));
}
return tmp;
}
real(8) function code(eh, ew, t)
real(8), intent (in) :: eh
real(8), intent (in) :: ew
real(8), intent (in) :: t
real(8) :: tmp
if ((ew <= (-3.8d-60)) .or. (.not. (ew <= 1.2d-119))) then
tmp = abs((ew * (cos(t) - (((eh * sin(t)) * sin(atan((tan(t) * (eh / -ew))))) / ew))))
else
tmp = abs((eh * ((ew * (cos(t) / eh)) - (sin(t) * sin(atan((eh * (tan(t) / -ew))))))))
end if
code = tmp
end function
public static double code(double eh, double ew, double t) {
double tmp;
if ((ew <= -3.8e-60) || !(ew <= 1.2e-119)) {
tmp = Math.abs((ew * (Math.cos(t) - (((eh * Math.sin(t)) * Math.sin(Math.atan((Math.tan(t) * (eh / -ew))))) / ew))));
} else {
tmp = Math.abs((eh * ((ew * (Math.cos(t) / eh)) - (Math.sin(t) * Math.sin(Math.atan((eh * (Math.tan(t) / -ew))))))));
}
return tmp;
}
def code(eh, ew, t): tmp = 0 if (ew <= -3.8e-60) or not (ew <= 1.2e-119): tmp = math.fabs((ew * (math.cos(t) - (((eh * math.sin(t)) * math.sin(math.atan((math.tan(t) * (eh / -ew))))) / ew)))) else: tmp = math.fabs((eh * ((ew * (math.cos(t) / eh)) - (math.sin(t) * math.sin(math.atan((eh * (math.tan(t) / -ew)))))))) return tmp
function code(eh, ew, t) tmp = 0.0 if ((ew <= -3.8e-60) || !(ew <= 1.2e-119)) tmp = abs(Float64(ew * Float64(cos(t) - Float64(Float64(Float64(eh * sin(t)) * sin(atan(Float64(tan(t) * Float64(eh / Float64(-ew)))))) / ew)))); else tmp = abs(Float64(eh * Float64(Float64(ew * Float64(cos(t) / eh)) - Float64(sin(t) * sin(atan(Float64(eh * Float64(tan(t) / Float64(-ew))))))))); end return tmp end
function tmp_2 = code(eh, ew, t) tmp = 0.0; if ((ew <= -3.8e-60) || ~((ew <= 1.2e-119))) tmp = abs((ew * (cos(t) - (((eh * sin(t)) * sin(atan((tan(t) * (eh / -ew))))) / ew)))); else tmp = abs((eh * ((ew * (cos(t) / eh)) - (sin(t) * sin(atan((eh * (tan(t) / -ew)))))))); end tmp_2 = tmp; end
code[eh_, ew_, t_] := If[Or[LessEqual[ew, -3.8e-60], N[Not[LessEqual[ew, 1.2e-119]], $MachinePrecision]], N[Abs[N[(ew * N[(N[Cos[t], $MachinePrecision] - N[(N[(N[(eh * N[Sin[t], $MachinePrecision]), $MachinePrecision] * N[Sin[N[ArcTan[N[(N[Tan[t], $MachinePrecision] * N[(eh / (-ew)), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / ew), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Abs[N[(eh * N[(N[(ew * N[(N[Cos[t], $MachinePrecision] / eh), $MachinePrecision]), $MachinePrecision] - N[(N[Sin[t], $MachinePrecision] * N[Sin[N[ArcTan[N[(eh * N[(N[Tan[t], $MachinePrecision] / (-ew)), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;ew \leq -3.8 \cdot 10^{-60} \lor \neg \left(ew \leq 1.2 \cdot 10^{-119}\right):\\
\;\;\;\;\left|ew \cdot \left(\cos t - \frac{\left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\tan t \cdot \frac{eh}{-ew}\right)}{ew}\right)\right|\\
\mathbf{else}:\\
\;\;\;\;\left|eh \cdot \left(ew \cdot \frac{\cos t}{eh} - \sin t \cdot \sin \tan^{-1} \left(eh \cdot \frac{\tan t}{-ew}\right)\right)\right|\\
\end{array}
\end{array}
if ew < -3.79999999999999994e-60 or 1.20000000000000004e-119 < ew Initial program 99.8%
add-cube-cbrt98.3%
pow398.4%
Applied egg-rr98.3%
Taylor expanded in ew around inf 97.6%
mul-1-neg97.6%
unsub-neg97.6%
associate-*r*97.6%
mul-1-neg97.6%
*-commutative97.6%
distribute-frac-neg297.6%
associate-*r/97.6%
Simplified97.6%
if -3.79999999999999994e-60 < ew < 1.20000000000000004e-119Initial program 99.8%
add-cube-cbrt99.1%
pow399.1%
Applied egg-rr99.1%
Taylor expanded in ew around inf 97.7%
Taylor expanded in eh around inf 98.4%
associate-/l*98.3%
mul-1-neg98.3%
associate-/l*98.3%
distribute-lft-neg-out98.3%
Simplified98.3%
Final simplification97.8%
(FPCore (eh ew t)
:precision binary64
(let* ((t_1 (* (sin t) (sin (atan (* eh (/ (tan t) (- ew))))))))
(if (or (<= ew -5.5e-46) (not (<= ew 1.4e-9)))
(fabs (* ew (- (cos t) (* eh (/ t_1 ew)))))
(fabs (* eh (- (* ew (/ (cos t) eh)) t_1))))))
double code(double eh, double ew, double t) {
double t_1 = sin(t) * sin(atan((eh * (tan(t) / -ew))));
double tmp;
if ((ew <= -5.5e-46) || !(ew <= 1.4e-9)) {
tmp = fabs((ew * (cos(t) - (eh * (t_1 / ew)))));
} else {
tmp = fabs((eh * ((ew * (cos(t) / eh)) - t_1)));
}
return tmp;
}
real(8) function code(eh, ew, t)
real(8), intent (in) :: eh
real(8), intent (in) :: ew
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = sin(t) * sin(atan((eh * (tan(t) / -ew))))
if ((ew <= (-5.5d-46)) .or. (.not. (ew <= 1.4d-9))) then
tmp = abs((ew * (cos(t) - (eh * (t_1 / ew)))))
else
tmp = abs((eh * ((ew * (cos(t) / eh)) - t_1)))
end if
code = tmp
end function
public static double code(double eh, double ew, double t) {
double t_1 = Math.sin(t) * Math.sin(Math.atan((eh * (Math.tan(t) / -ew))));
double tmp;
if ((ew <= -5.5e-46) || !(ew <= 1.4e-9)) {
tmp = Math.abs((ew * (Math.cos(t) - (eh * (t_1 / ew)))));
} else {
tmp = Math.abs((eh * ((ew * (Math.cos(t) / eh)) - t_1)));
}
return tmp;
}
def code(eh, ew, t): t_1 = math.sin(t) * math.sin(math.atan((eh * (math.tan(t) / -ew)))) tmp = 0 if (ew <= -5.5e-46) or not (ew <= 1.4e-9): tmp = math.fabs((ew * (math.cos(t) - (eh * (t_1 / ew))))) else: tmp = math.fabs((eh * ((ew * (math.cos(t) / eh)) - t_1))) return tmp
function code(eh, ew, t) t_1 = Float64(sin(t) * sin(atan(Float64(eh * Float64(tan(t) / Float64(-ew)))))) tmp = 0.0 if ((ew <= -5.5e-46) || !(ew <= 1.4e-9)) tmp = abs(Float64(ew * Float64(cos(t) - Float64(eh * Float64(t_1 / ew))))); else tmp = abs(Float64(eh * Float64(Float64(ew * Float64(cos(t) / eh)) - t_1))); end return tmp end
function tmp_2 = code(eh, ew, t) t_1 = sin(t) * sin(atan((eh * (tan(t) / -ew)))); tmp = 0.0; if ((ew <= -5.5e-46) || ~((ew <= 1.4e-9))) tmp = abs((ew * (cos(t) - (eh * (t_1 / ew))))); else tmp = abs((eh * ((ew * (cos(t) / eh)) - t_1))); end tmp_2 = tmp; end
code[eh_, ew_, t_] := Block[{t$95$1 = N[(N[Sin[t], $MachinePrecision] * N[Sin[N[ArcTan[N[(eh * N[(N[Tan[t], $MachinePrecision] / (-ew)), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[ew, -5.5e-46], N[Not[LessEqual[ew, 1.4e-9]], $MachinePrecision]], N[Abs[N[(ew * N[(N[Cos[t], $MachinePrecision] - N[(eh * N[(t$95$1 / ew), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Abs[N[(eh * N[(N[(ew * N[(N[Cos[t], $MachinePrecision] / eh), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \sin t \cdot \sin \tan^{-1} \left(eh \cdot \frac{\tan t}{-ew}\right)\\
\mathbf{if}\;ew \leq -5.5 \cdot 10^{-46} \lor \neg \left(ew \leq 1.4 \cdot 10^{-9}\right):\\
\;\;\;\;\left|ew \cdot \left(\cos t - eh \cdot \frac{t\_1}{ew}\right)\right|\\
\mathbf{else}:\\
\;\;\;\;\left|eh \cdot \left(ew \cdot \frac{\cos t}{eh} - t\_1\right)\right|\\
\end{array}
\end{array}
if ew < -5.49999999999999983e-46 or 1.39999999999999992e-9 < ew Initial program 99.8%
add-cube-cbrt98.3%
pow398.4%
Applied egg-rr98.3%
rem-cube-cbrt99.8%
clear-num99.6%
Applied egg-rr99.6%
Taylor expanded in ew around inf 98.0%
mul-1-neg98.0%
unsub-neg98.0%
associate-/l*98.0%
Simplified98.0%
if -5.49999999999999983e-46 < ew < 1.39999999999999992e-9Initial program 99.8%
add-cube-cbrt98.9%
pow398.9%
Applied egg-rr98.9%
Taylor expanded in ew around inf 96.9%
Taylor expanded in eh around inf 97.7%
associate-/l*97.6%
mul-1-neg97.6%
associate-/l*97.6%
distribute-lft-neg-out97.6%
Simplified97.6%
Final simplification97.8%
(FPCore (eh ew t)
:precision binary64
(if (or (<= eh -1.8e-92) (not (<= eh 4.5e-38)))
(fabs
(*
eh
(-
(* ew (/ (cos t) eh))
(* (sin t) (sin (atan (* eh (/ (tan t) (- ew)))))))))
(fabs (* ew (cos t)))))
double code(double eh, double ew, double t) {
double tmp;
if ((eh <= -1.8e-92) || !(eh <= 4.5e-38)) {
tmp = fabs((eh * ((ew * (cos(t) / eh)) - (sin(t) * sin(atan((eh * (tan(t) / -ew))))))));
} else {
tmp = fabs((ew * cos(t)));
}
return tmp;
}
real(8) function code(eh, ew, t)
real(8), intent (in) :: eh
real(8), intent (in) :: ew
real(8), intent (in) :: t
real(8) :: tmp
if ((eh <= (-1.8d-92)) .or. (.not. (eh <= 4.5d-38))) then
tmp = abs((eh * ((ew * (cos(t) / eh)) - (sin(t) * sin(atan((eh * (tan(t) / -ew))))))))
else
tmp = abs((ew * cos(t)))
end if
code = tmp
end function
public static double code(double eh, double ew, double t) {
double tmp;
if ((eh <= -1.8e-92) || !(eh <= 4.5e-38)) {
tmp = Math.abs((eh * ((ew * (Math.cos(t) / eh)) - (Math.sin(t) * Math.sin(Math.atan((eh * (Math.tan(t) / -ew))))))));
} else {
tmp = Math.abs((ew * Math.cos(t)));
}
return tmp;
}
def code(eh, ew, t): tmp = 0 if (eh <= -1.8e-92) or not (eh <= 4.5e-38): tmp = math.fabs((eh * ((ew * (math.cos(t) / eh)) - (math.sin(t) * math.sin(math.atan((eh * (math.tan(t) / -ew)))))))) else: tmp = math.fabs((ew * math.cos(t))) return tmp
function code(eh, ew, t) tmp = 0.0 if ((eh <= -1.8e-92) || !(eh <= 4.5e-38)) tmp = abs(Float64(eh * Float64(Float64(ew * Float64(cos(t) / eh)) - Float64(sin(t) * sin(atan(Float64(eh * Float64(tan(t) / Float64(-ew))))))))); else tmp = abs(Float64(ew * cos(t))); end return tmp end
function tmp_2 = code(eh, ew, t) tmp = 0.0; if ((eh <= -1.8e-92) || ~((eh <= 4.5e-38))) tmp = abs((eh * ((ew * (cos(t) / eh)) - (sin(t) * sin(atan((eh * (tan(t) / -ew)))))))); else tmp = abs((ew * cos(t))); end tmp_2 = tmp; end
code[eh_, ew_, t_] := If[Or[LessEqual[eh, -1.8e-92], N[Not[LessEqual[eh, 4.5e-38]], $MachinePrecision]], N[Abs[N[(eh * N[(N[(ew * N[(N[Cos[t], $MachinePrecision] / eh), $MachinePrecision]), $MachinePrecision] - N[(N[Sin[t], $MachinePrecision] * N[Sin[N[ArcTan[N[(eh * N[(N[Tan[t], $MachinePrecision] / (-ew)), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Abs[N[(ew * N[Cos[t], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;eh \leq -1.8 \cdot 10^{-92} \lor \neg \left(eh \leq 4.5 \cdot 10^{-38}\right):\\
\;\;\;\;\left|eh \cdot \left(ew \cdot \frac{\cos t}{eh} - \sin t \cdot \sin \tan^{-1} \left(eh \cdot \frac{\tan t}{-ew}\right)\right)\right|\\
\mathbf{else}:\\
\;\;\;\;\left|ew \cdot \cos t\right|\\
\end{array}
\end{array}
if eh < -1.80000000000000008e-92 or 4.50000000000000009e-38 < eh Initial program 99.8%
add-cube-cbrt99.1%
pow399.1%
Applied egg-rr99.1%
Taylor expanded in ew around inf 96.9%
Taylor expanded in eh around inf 97.4%
associate-/l*97.3%
mul-1-neg97.3%
associate-/l*97.3%
distribute-lft-neg-out97.3%
Simplified97.3%
if -1.80000000000000008e-92 < eh < 4.50000000000000009e-38Initial program 99.8%
add-cube-cbrt97.9%
pow397.9%
Applied egg-rr97.9%
Taylor expanded in ew around inf 96.5%
rem-cube-cbrt98.4%
add-cbrt-cube40.6%
Applied egg-rr40.6%
Taylor expanded in ew around inf 92.8%
Final simplification95.5%
(FPCore (eh ew t) :precision binary64 (fabs (- (* (* eh (sin t)) (sin (atan (/ (* (- eh) (tan t)) ew)))) (/ 1.0 (/ 1.0 (* ew (cos t)))))))
double code(double eh, double ew, double t) {
return fabs((((eh * sin(t)) * sin(atan(((-eh * tan(t)) / ew)))) - (1.0 / (1.0 / (ew * cos(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 * sin(t)) * sin(atan(((-eh * tan(t)) / ew)))) - (1.0d0 / (1.0d0 / (ew * cos(t))))))
end function
public static double code(double eh, double ew, double t) {
return Math.abs((((eh * Math.sin(t)) * Math.sin(Math.atan(((-eh * Math.tan(t)) / ew)))) - (1.0 / (1.0 / (ew * Math.cos(t))))));
}
def code(eh, ew, t): return math.fabs((((eh * math.sin(t)) * math.sin(math.atan(((-eh * math.tan(t)) / ew)))) - (1.0 / (1.0 / (ew * math.cos(t))))))
function code(eh, ew, t) return abs(Float64(Float64(Float64(eh * sin(t)) * sin(atan(Float64(Float64(Float64(-eh) * tan(t)) / ew)))) - Float64(1.0 / Float64(1.0 / Float64(ew * cos(t)))))) end
function tmp = code(eh, ew, t) tmp = abs((((eh * sin(t)) * sin(atan(((-eh * tan(t)) / ew)))) - (1.0 / (1.0 / (ew * cos(t)))))); end
code[eh_, ew_, t_] := N[Abs[N[(N[(N[(eh * N[Sin[t], $MachinePrecision]), $MachinePrecision] * N[Sin[N[ArcTan[N[(N[((-eh) * N[Tan[t], $MachinePrecision]), $MachinePrecision] / ew), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - N[(1.0 / N[(1.0 / N[(ew * N[Cos[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\left|\left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) - \frac{1}{\frac{1}{ew \cdot \cos t}}\right|
\end{array}
Initial program 99.8%
add-cube-cbrt98.6%
pow398.6%
Applied egg-rr98.6%
rem-cube-cbrt99.8%
clear-num99.6%
Applied egg-rr99.6%
Taylor expanded in eh around 0 97.8%
Final simplification97.8%
(FPCore (eh ew t) :precision binary64 (if (or (<= eh -2.8e+26) (not (<= eh 7.5e+62))) (fabs (* (* eh (sin t)) (sin (atan (* (tan t) (/ eh (- ew))))))) (fabs (* ew (cos t)))))
double code(double eh, double ew, double t) {
double tmp;
if ((eh <= -2.8e+26) || !(eh <= 7.5e+62)) {
tmp = fabs(((eh * sin(t)) * sin(atan((tan(t) * (eh / -ew))))));
} else {
tmp = fabs((ew * cos(t)));
}
return tmp;
}
real(8) function code(eh, ew, t)
real(8), intent (in) :: eh
real(8), intent (in) :: ew
real(8), intent (in) :: t
real(8) :: tmp
if ((eh <= (-2.8d+26)) .or. (.not. (eh <= 7.5d+62))) then
tmp = abs(((eh * sin(t)) * sin(atan((tan(t) * (eh / -ew))))))
else
tmp = abs((ew * cos(t)))
end if
code = tmp
end function
public static double code(double eh, double ew, double t) {
double tmp;
if ((eh <= -2.8e+26) || !(eh <= 7.5e+62)) {
tmp = Math.abs(((eh * Math.sin(t)) * Math.sin(Math.atan((Math.tan(t) * (eh / -ew))))));
} else {
tmp = Math.abs((ew * Math.cos(t)));
}
return tmp;
}
def code(eh, ew, t): tmp = 0 if (eh <= -2.8e+26) or not (eh <= 7.5e+62): tmp = math.fabs(((eh * math.sin(t)) * math.sin(math.atan((math.tan(t) * (eh / -ew)))))) else: tmp = math.fabs((ew * math.cos(t))) return tmp
function code(eh, ew, t) tmp = 0.0 if ((eh <= -2.8e+26) || !(eh <= 7.5e+62)) tmp = abs(Float64(Float64(eh * sin(t)) * sin(atan(Float64(tan(t) * Float64(eh / Float64(-ew))))))); else tmp = abs(Float64(ew * cos(t))); end return tmp end
function tmp_2 = code(eh, ew, t) tmp = 0.0; if ((eh <= -2.8e+26) || ~((eh <= 7.5e+62))) tmp = abs(((eh * sin(t)) * sin(atan((tan(t) * (eh / -ew)))))); else tmp = abs((ew * cos(t))); end tmp_2 = tmp; end
code[eh_, ew_, t_] := If[Or[LessEqual[eh, -2.8e+26], N[Not[LessEqual[eh, 7.5e+62]], $MachinePrecision]], N[Abs[N[(N[(eh * N[Sin[t], $MachinePrecision]), $MachinePrecision] * N[Sin[N[ArcTan[N[(N[Tan[t], $MachinePrecision] * N[(eh / (-ew)), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Abs[N[(ew * N[Cos[t], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;eh \leq -2.8 \cdot 10^{+26} \lor \neg \left(eh \leq 7.5 \cdot 10^{+62}\right):\\
\;\;\;\;\left|\left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\tan t \cdot \frac{eh}{-ew}\right)\right|\\
\mathbf{else}:\\
\;\;\;\;\left|ew \cdot \cos t\right|\\
\end{array}
\end{array}
if eh < -2.8e26 or 7.49999999999999998e62 < eh Initial program 99.8%
Taylor expanded in ew around 0 74.6%
associate-*r*74.6%
associate-*r*74.7%
mul-1-neg74.7%
mul-1-neg74.7%
distribute-frac-neg274.7%
*-commutative74.7%
associate-/l*74.7%
Simplified74.7%
if -2.8e26 < eh < 7.49999999999999998e62Initial program 99.8%
add-cube-cbrt98.1%
pow398.1%
Applied egg-rr98.1%
Taylor expanded in ew around inf 96.4%
rem-cube-cbrt98.1%
add-cbrt-cube49.3%
Applied egg-rr49.4%
Taylor expanded in ew around inf 85.5%
Final simplification80.8%
(FPCore (eh ew t)
:precision binary64
(let* ((t_1 (* ew (cos t))))
(if (<= t -14000.0)
(fabs t_1)
(if (<= t 3.45e-13)
(fabs
(+
ew
(*
t
(-
(* -0.5 (* ew t))
(* eh (sin (atan (* eh (/ (tan t) (- ew))))))))))
(- (* (- eh) (* (sin t) (sin (atan (/ (* eh t) ew))))) t_1)))))
double code(double eh, double ew, double t) {
double t_1 = ew * cos(t);
double tmp;
if (t <= -14000.0) {
tmp = fabs(t_1);
} else if (t <= 3.45e-13) {
tmp = fabs((ew + (t * ((-0.5 * (ew * t)) - (eh * sin(atan((eh * (tan(t) / -ew)))))))));
} else {
tmp = (-eh * (sin(t) * sin(atan(((eh * t) / ew))))) - t_1;
}
return tmp;
}
real(8) function code(eh, ew, t)
real(8), intent (in) :: eh
real(8), intent (in) :: ew
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = ew * cos(t)
if (t <= (-14000.0d0)) then
tmp = abs(t_1)
else if (t <= 3.45d-13) then
tmp = abs((ew + (t * (((-0.5d0) * (ew * t)) - (eh * sin(atan((eh * (tan(t) / -ew)))))))))
else
tmp = (-eh * (sin(t) * sin(atan(((eh * t) / ew))))) - t_1
end if
code = tmp
end function
public static double code(double eh, double ew, double t) {
double t_1 = ew * Math.cos(t);
double tmp;
if (t <= -14000.0) {
tmp = Math.abs(t_1);
} else if (t <= 3.45e-13) {
tmp = Math.abs((ew + (t * ((-0.5 * (ew * t)) - (eh * Math.sin(Math.atan((eh * (Math.tan(t) / -ew)))))))));
} else {
tmp = (-eh * (Math.sin(t) * Math.sin(Math.atan(((eh * t) / ew))))) - t_1;
}
return tmp;
}
def code(eh, ew, t): t_1 = ew * math.cos(t) tmp = 0 if t <= -14000.0: tmp = math.fabs(t_1) elif t <= 3.45e-13: tmp = math.fabs((ew + (t * ((-0.5 * (ew * t)) - (eh * math.sin(math.atan((eh * (math.tan(t) / -ew))))))))) else: tmp = (-eh * (math.sin(t) * math.sin(math.atan(((eh * t) / ew))))) - t_1 return tmp
function code(eh, ew, t) t_1 = Float64(ew * cos(t)) tmp = 0.0 if (t <= -14000.0) tmp = abs(t_1); elseif (t <= 3.45e-13) tmp = abs(Float64(ew + Float64(t * Float64(Float64(-0.5 * Float64(ew * t)) - Float64(eh * sin(atan(Float64(eh * Float64(tan(t) / Float64(-ew)))))))))); else tmp = Float64(Float64(Float64(-eh) * Float64(sin(t) * sin(atan(Float64(Float64(eh * t) / ew))))) - t_1); end return tmp end
function tmp_2 = code(eh, ew, t) t_1 = ew * cos(t); tmp = 0.0; if (t <= -14000.0) tmp = abs(t_1); elseif (t <= 3.45e-13) tmp = abs((ew + (t * ((-0.5 * (ew * t)) - (eh * sin(atan((eh * (tan(t) / -ew))))))))); else tmp = (-eh * (sin(t) * sin(atan(((eh * t) / ew))))) - t_1; end tmp_2 = tmp; end
code[eh_, ew_, t_] := Block[{t$95$1 = N[(ew * N[Cos[t], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -14000.0], N[Abs[t$95$1], $MachinePrecision], If[LessEqual[t, 3.45e-13], N[Abs[N[(ew + N[(t * N[(N[(-0.5 * N[(ew * t), $MachinePrecision]), $MachinePrecision] - N[(eh * N[Sin[N[ArcTan[N[(eh * N[(N[Tan[t], $MachinePrecision] / (-ew)), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(N[((-eh) * N[(N[Sin[t], $MachinePrecision] * N[Sin[N[ArcTan[N[(N[(eh * t), $MachinePrecision] / ew), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := ew \cdot \cos t\\
\mathbf{if}\;t \leq -14000:\\
\;\;\;\;\left|t\_1\right|\\
\mathbf{elif}\;t \leq 3.45 \cdot 10^{-13}:\\
\;\;\;\;\left|ew + t \cdot \left(-0.5 \cdot \left(ew \cdot t\right) - eh \cdot \sin \tan^{-1} \left(eh \cdot \frac{\tan t}{-ew}\right)\right)\right|\\
\mathbf{else}:\\
\;\;\;\;\left(-eh\right) \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\frac{eh \cdot t}{ew}\right)\right) - t\_1\\
\end{array}
\end{array}
if t < -14000Initial program 99.7%
add-cube-cbrt98.6%
pow398.7%
Applied egg-rr98.7%
Taylor expanded in ew around inf 96.2%
rem-cube-cbrt97.2%
add-cbrt-cube37.6%
Applied egg-rr37.6%
Taylor expanded in ew around inf 55.4%
if -14000 < t < 3.44999999999999994e-13Initial program 99.9%
add-cube-cbrt98.3%
pow398.3%
Applied egg-rr98.3%
Taylor expanded in ew around inf 96.9%
Taylor expanded in t around 0 96.9%
mul-1-neg96.9%
associate-/l*96.9%
distribute-lft-neg-out96.9%
Simplified96.9%
if 3.44999999999999994e-13 < t Initial program 99.6%
Applied egg-rr48.3%
Taylor expanded in eh around 0 46.7%
associate-*r*46.7%
neg-mul-146.7%
associate-*r/46.7%
associate-*r/46.7%
*-commutative46.7%
associate-*r/46.7%
*-commutative46.7%
Simplified46.7%
Taylor expanded in t around 0 57.2%
Final simplification74.2%
(FPCore (eh ew t)
:precision binary64
(let* ((t_1 (* ew (cos t))))
(if (<= t -4.8e-5)
(fabs t_1)
(if (<= t 3.45e-13)
(fabs (- ew (* (sin (atan (* (tan t) (/ eh (- ew))))) (* eh t))))
(- (* (- eh) (* (sin t) (sin (atan (/ (* eh t) ew))))) t_1)))))
double code(double eh, double ew, double t) {
double t_1 = ew * cos(t);
double tmp;
if (t <= -4.8e-5) {
tmp = fabs(t_1);
} else if (t <= 3.45e-13) {
tmp = fabs((ew - (sin(atan((tan(t) * (eh / -ew)))) * (eh * t))));
} else {
tmp = (-eh * (sin(t) * sin(atan(((eh * t) / ew))))) - t_1;
}
return tmp;
}
real(8) function code(eh, ew, t)
real(8), intent (in) :: eh
real(8), intent (in) :: ew
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = ew * cos(t)
if (t <= (-4.8d-5)) then
tmp = abs(t_1)
else if (t <= 3.45d-13) then
tmp = abs((ew - (sin(atan((tan(t) * (eh / -ew)))) * (eh * t))))
else
tmp = (-eh * (sin(t) * sin(atan(((eh * t) / ew))))) - t_1
end if
code = tmp
end function
public static double code(double eh, double ew, double t) {
double t_1 = ew * Math.cos(t);
double tmp;
if (t <= -4.8e-5) {
tmp = Math.abs(t_1);
} else if (t <= 3.45e-13) {
tmp = Math.abs((ew - (Math.sin(Math.atan((Math.tan(t) * (eh / -ew)))) * (eh * t))));
} else {
tmp = (-eh * (Math.sin(t) * Math.sin(Math.atan(((eh * t) / ew))))) - t_1;
}
return tmp;
}
def code(eh, ew, t): t_1 = ew * math.cos(t) tmp = 0 if t <= -4.8e-5: tmp = math.fabs(t_1) elif t <= 3.45e-13: tmp = math.fabs((ew - (math.sin(math.atan((math.tan(t) * (eh / -ew)))) * (eh * t)))) else: tmp = (-eh * (math.sin(t) * math.sin(math.atan(((eh * t) / ew))))) - t_1 return tmp
function code(eh, ew, t) t_1 = Float64(ew * cos(t)) tmp = 0.0 if (t <= -4.8e-5) tmp = abs(t_1); elseif (t <= 3.45e-13) tmp = abs(Float64(ew - Float64(sin(atan(Float64(tan(t) * Float64(eh / Float64(-ew))))) * Float64(eh * t)))); else tmp = Float64(Float64(Float64(-eh) * Float64(sin(t) * sin(atan(Float64(Float64(eh * t) / ew))))) - t_1); end return tmp end
function tmp_2 = code(eh, ew, t) t_1 = ew * cos(t); tmp = 0.0; if (t <= -4.8e-5) tmp = abs(t_1); elseif (t <= 3.45e-13) tmp = abs((ew - (sin(atan((tan(t) * (eh / -ew)))) * (eh * t)))); else tmp = (-eh * (sin(t) * sin(atan(((eh * t) / ew))))) - t_1; end tmp_2 = tmp; end
code[eh_, ew_, t_] := Block[{t$95$1 = N[(ew * N[Cos[t], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -4.8e-5], N[Abs[t$95$1], $MachinePrecision], If[LessEqual[t, 3.45e-13], N[Abs[N[(ew - N[(N[Sin[N[ArcTan[N[(N[Tan[t], $MachinePrecision] * N[(eh / (-ew)), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * N[(eh * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(N[((-eh) * N[(N[Sin[t], $MachinePrecision] * N[Sin[N[ArcTan[N[(N[(eh * t), $MachinePrecision] / ew), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := ew \cdot \cos t\\
\mathbf{if}\;t \leq -4.8 \cdot 10^{-5}:\\
\;\;\;\;\left|t\_1\right|\\
\mathbf{elif}\;t \leq 3.45 \cdot 10^{-13}:\\
\;\;\;\;\left|ew - \sin \tan^{-1} \left(\tan t \cdot \frac{eh}{-ew}\right) \cdot \left(eh \cdot t\right)\right|\\
\mathbf{else}:\\
\;\;\;\;\left(-eh\right) \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\frac{eh \cdot t}{ew}\right)\right) - t\_1\\
\end{array}
\end{array}
if t < -4.8000000000000001e-5Initial program 99.6%
add-cube-cbrt98.6%
pow398.7%
Applied egg-rr98.7%
Taylor expanded in ew around inf 96.3%
rem-cube-cbrt97.2%
add-cbrt-cube37.5%
Applied egg-rr37.5%
Taylor expanded in ew around inf 54.6%
if -4.8000000000000001e-5 < t < 3.44999999999999994e-13Initial program 100.0%
add-cube-cbrt98.3%
pow398.3%
Applied egg-rr98.3%
Taylor expanded in t around 0 98.4%
mul-1-neg98.4%
unsub-neg98.4%
associate-*r*98.4%
*-commutative98.4%
mul-1-neg98.4%
*-commutative98.4%
distribute-frac-neg298.4%
associate-*r/98.4%
Simplified98.4%
if 3.44999999999999994e-13 < t Initial program 99.6%
Applied egg-rr48.3%
Taylor expanded in eh around 0 46.7%
associate-*r*46.7%
neg-mul-146.7%
associate-*r/46.7%
associate-*r/46.7%
*-commutative46.7%
associate-*r/46.7%
*-commutative46.7%
Simplified46.7%
Taylor expanded in t around 0 57.2%
Final simplification74.1%
(FPCore (eh ew t) :precision binary64 (if (or (<= t -4.5e-6) (not (<= t 2800000000.0))) (fabs (* ew (cos t))) (fabs (- ew (* (sin (atan (* (tan t) (/ eh (- ew))))) (* eh t))))))
double code(double eh, double ew, double t) {
double tmp;
if ((t <= -4.5e-6) || !(t <= 2800000000.0)) {
tmp = fabs((ew * cos(t)));
} else {
tmp = fabs((ew - (sin(atan((tan(t) * (eh / -ew)))) * (eh * t))));
}
return tmp;
}
real(8) function code(eh, ew, t)
real(8), intent (in) :: eh
real(8), intent (in) :: ew
real(8), intent (in) :: t
real(8) :: tmp
if ((t <= (-4.5d-6)) .or. (.not. (t <= 2800000000.0d0))) then
tmp = abs((ew * cos(t)))
else
tmp = abs((ew - (sin(atan((tan(t) * (eh / -ew)))) * (eh * t))))
end if
code = tmp
end function
public static double code(double eh, double ew, double t) {
double tmp;
if ((t <= -4.5e-6) || !(t <= 2800000000.0)) {
tmp = Math.abs((ew * Math.cos(t)));
} else {
tmp = Math.abs((ew - (Math.sin(Math.atan((Math.tan(t) * (eh / -ew)))) * (eh * t))));
}
return tmp;
}
def code(eh, ew, t): tmp = 0 if (t <= -4.5e-6) or not (t <= 2800000000.0): tmp = math.fabs((ew * math.cos(t))) else: tmp = math.fabs((ew - (math.sin(math.atan((math.tan(t) * (eh / -ew)))) * (eh * t)))) return tmp
function code(eh, ew, t) tmp = 0.0 if ((t <= -4.5e-6) || !(t <= 2800000000.0)) tmp = abs(Float64(ew * cos(t))); else tmp = abs(Float64(ew - Float64(sin(atan(Float64(tan(t) * Float64(eh / Float64(-ew))))) * Float64(eh * t)))); end return tmp end
function tmp_2 = code(eh, ew, t) tmp = 0.0; if ((t <= -4.5e-6) || ~((t <= 2800000000.0))) tmp = abs((ew * cos(t))); else tmp = abs((ew - (sin(atan((tan(t) * (eh / -ew)))) * (eh * t)))); end tmp_2 = tmp; end
code[eh_, ew_, t_] := If[Or[LessEqual[t, -4.5e-6], N[Not[LessEqual[t, 2800000000.0]], $MachinePrecision]], N[Abs[N[(ew * N[Cos[t], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Abs[N[(ew - N[(N[Sin[N[ArcTan[N[(N[Tan[t], $MachinePrecision] * N[(eh / (-ew)), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * N[(eh * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -4.5 \cdot 10^{-6} \lor \neg \left(t \leq 2800000000\right):\\
\;\;\;\;\left|ew \cdot \cos t\right|\\
\mathbf{else}:\\
\;\;\;\;\left|ew - \sin \tan^{-1} \left(\tan t \cdot \frac{eh}{-ew}\right) \cdot \left(eh \cdot t\right)\right|\\
\end{array}
\end{array}
if t < -4.50000000000000011e-6 or 2.8e9 < t Initial program 99.6%
add-cube-cbrt98.7%
pow398.8%
Applied egg-rr98.8%
Taylor expanded in ew around inf 96.6%
rem-cube-cbrt97.4%
add-cbrt-cube38.9%
Applied egg-rr38.9%
Taylor expanded in ew around inf 51.3%
if -4.50000000000000011e-6 < t < 2.8e9Initial program 100.0%
add-cube-cbrt98.4%
pow398.3%
Applied egg-rr98.3%
Taylor expanded in t around 0 97.0%
mul-1-neg97.0%
unsub-neg97.0%
associate-*r*97.0%
*-commutative97.0%
mul-1-neg97.0%
*-commutative97.0%
distribute-frac-neg297.0%
associate-*r/97.0%
Simplified97.0%
Final simplification71.6%
(FPCore (eh ew t) :precision binary64 (if (or (<= ew -1.25e-76) (not (<= ew -8e-298))) (fabs (* ew (cos t))) (* (* eh (sin t)) (- (sin (atan (* (tan t) (/ eh ew))))))))
double code(double eh, double ew, double t) {
double tmp;
if ((ew <= -1.25e-76) || !(ew <= -8e-298)) {
tmp = fabs((ew * cos(t)));
} else {
tmp = (eh * sin(t)) * -sin(atan((tan(t) * (eh / 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.25d-76)) .or. (.not. (ew <= (-8d-298)))) then
tmp = abs((ew * cos(t)))
else
tmp = (eh * sin(t)) * -sin(atan((tan(t) * (eh / ew))))
end if
code = tmp
end function
public static double code(double eh, double ew, double t) {
double tmp;
if ((ew <= -1.25e-76) || !(ew <= -8e-298)) {
tmp = Math.abs((ew * Math.cos(t)));
} else {
tmp = (eh * Math.sin(t)) * -Math.sin(Math.atan((Math.tan(t) * (eh / ew))));
}
return tmp;
}
def code(eh, ew, t): tmp = 0 if (ew <= -1.25e-76) or not (ew <= -8e-298): tmp = math.fabs((ew * math.cos(t))) else: tmp = (eh * math.sin(t)) * -math.sin(math.atan((math.tan(t) * (eh / ew)))) return tmp
function code(eh, ew, t) tmp = 0.0 if ((ew <= -1.25e-76) || !(ew <= -8e-298)) tmp = abs(Float64(ew * cos(t))); else tmp = Float64(Float64(eh * sin(t)) * Float64(-sin(atan(Float64(tan(t) * Float64(eh / ew)))))); end return tmp end
function tmp_2 = code(eh, ew, t) tmp = 0.0; if ((ew <= -1.25e-76) || ~((ew <= -8e-298))) tmp = abs((ew * cos(t))); else tmp = (eh * sin(t)) * -sin(atan((tan(t) * (eh / ew)))); end tmp_2 = tmp; end
code[eh_, ew_, t_] := If[Or[LessEqual[ew, -1.25e-76], N[Not[LessEqual[ew, -8e-298]], $MachinePrecision]], N[Abs[N[(ew * N[Cos[t], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(N[(eh * N[Sin[t], $MachinePrecision]), $MachinePrecision] * (-N[Sin[N[ArcTan[N[(N[Tan[t], $MachinePrecision] * N[(eh / ew), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision])), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;ew \leq -1.25 \cdot 10^{-76} \lor \neg \left(ew \leq -8 \cdot 10^{-298}\right):\\
\;\;\;\;\left|ew \cdot \cos t\right|\\
\mathbf{else}:\\
\;\;\;\;\left(eh \cdot \sin t\right) \cdot \left(-\sin \tan^{-1} \left(\tan t \cdot \frac{eh}{ew}\right)\right)\\
\end{array}
\end{array}
if ew < -1.2499999999999999e-76 or -7.9999999999999993e-298 < ew Initial program 99.8%
add-cube-cbrt98.5%
pow398.5%
Applied egg-rr98.5%
Taylor expanded in ew around inf 96.2%
rem-cube-cbrt97.5%
add-cbrt-cube42.5%
Applied egg-rr42.5%
Taylor expanded in ew around inf 68.9%
if -1.2499999999999999e-76 < ew < -7.9999999999999993e-298Initial program 99.8%
Applied egg-rr74.4%
Taylor expanded in eh around inf 59.3%
associate-*r*59.3%
associate-*r/59.3%
associate-*r/59.3%
*-commutative59.3%
associate-*r/59.3%
*-commutative59.3%
Simplified59.3%
Final simplification67.0%
(FPCore (eh ew t) :precision binary64 (fabs (* ew (cos t))))
double code(double eh, double ew, double t) {
return fabs((ew * cos(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 * cos(t)))
end function
public static double code(double eh, double ew, double t) {
return Math.abs((ew * Math.cos(t)));
}
def code(eh, ew, t): return math.fabs((ew * math.cos(t)))
function code(eh, ew, t) return abs(Float64(ew * cos(t))) end
function tmp = code(eh, ew, t) tmp = abs((ew * cos(t))); end
code[eh_, ew_, t_] := N[Abs[N[(ew * N[Cos[t], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\left|ew \cdot \cos t\right|
\end{array}
Initial program 99.8%
add-cube-cbrt98.6%
pow398.6%
Applied egg-rr98.6%
Taylor expanded in ew around inf 96.7%
rem-cube-cbrt97.9%
add-cbrt-cube42.7%
Applied egg-rr42.8%
Taylor expanded in ew around inf 60.7%
(FPCore (eh ew t) :precision binary64 (if (or (<= t -4.5e-5) (not (<= t 11500000000.0))) (* ew (- (cos t))) (fabs ew)))
double code(double eh, double ew, double t) {
double tmp;
if ((t <= -4.5e-5) || !(t <= 11500000000.0)) {
tmp = ew * -cos(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 <= (-4.5d-5)) .or. (.not. (t <= 11500000000.0d0))) then
tmp = ew * -cos(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 <= -4.5e-5) || !(t <= 11500000000.0)) {
tmp = ew * -Math.cos(t);
} else {
tmp = Math.abs(ew);
}
return tmp;
}
def code(eh, ew, t): tmp = 0 if (t <= -4.5e-5) or not (t <= 11500000000.0): tmp = ew * -math.cos(t) else: tmp = math.fabs(ew) return tmp
function code(eh, ew, t) tmp = 0.0 if ((t <= -4.5e-5) || !(t <= 11500000000.0)) tmp = Float64(ew * Float64(-cos(t))); else tmp = abs(ew); end return tmp end
function tmp_2 = code(eh, ew, t) tmp = 0.0; if ((t <= -4.5e-5) || ~((t <= 11500000000.0))) tmp = ew * -cos(t); else tmp = abs(ew); end tmp_2 = tmp; end
code[eh_, ew_, t_] := If[Or[LessEqual[t, -4.5e-5], N[Not[LessEqual[t, 11500000000.0]], $MachinePrecision]], N[(ew * (-N[Cos[t], $MachinePrecision])), $MachinePrecision], N[Abs[ew], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -4.5 \cdot 10^{-5} \lor \neg \left(t \leq 11500000000\right):\\
\;\;\;\;ew \cdot \left(-\cos t\right)\\
\mathbf{else}:\\
\;\;\;\;\left|ew\right|\\
\end{array}
\end{array}
if t < -4.50000000000000028e-5 or 1.15e10 < t Initial program 99.6%
Applied egg-rr53.1%
Taylor expanded in eh around 0 28.4%
neg-mul-128.4%
distribute-lft-neg-in28.4%
Simplified28.4%
if -4.50000000000000028e-5 < t < 1.15e10Initial program 100.0%
add-cube-cbrt98.4%
pow398.3%
Applied egg-rr98.3%
Taylor expanded in ew around inf 96.9%
rem-cube-cbrt98.5%
add-cbrt-cube47.5%
Applied egg-rr47.6%
Taylor expanded in t around 0 72.4%
Final simplification48.0%
(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%
add-cube-cbrt98.6%
pow398.6%
Applied egg-rr98.6%
Taylor expanded in ew around inf 96.7%
rem-cube-cbrt97.9%
add-cbrt-cube42.7%
Applied egg-rr42.8%
Taylor expanded in t around 0 39.8%
(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-rr49.8%
Taylor expanded in t around 0 18.3%
neg-mul-118.3%
Simplified18.3%
herbie shell --seed 2024135
(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)))))))