
(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 (/ (* (tan t) eh) (- ew))))) (fabs (- (* (* (sin t) eh) (sin t_1)) (* (* (cos t) ew) (cos t_1))))))
double code(double eh, double ew, double t) {
double t_1 = atan(((tan(t) * eh) / -ew));
return fabs((((sin(t) * eh) * sin(t_1)) - ((cos(t) * ew) * cos(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(((tan(t) * eh) / -ew))
code = abs((((sin(t) * eh) * sin(t_1)) - ((cos(t) * ew) * cos(t_1))))
end function
public static double code(double eh, double ew, double t) {
double t_1 = Math.atan(((Math.tan(t) * eh) / -ew));
return Math.abs((((Math.sin(t) * eh) * Math.sin(t_1)) - ((Math.cos(t) * ew) * Math.cos(t_1))));
}
def code(eh, ew, t): t_1 = math.atan(((math.tan(t) * eh) / -ew)) return math.fabs((((math.sin(t) * eh) * math.sin(t_1)) - ((math.cos(t) * ew) * math.cos(t_1))))
function code(eh, ew, t) t_1 = atan(Float64(Float64(tan(t) * eh) / Float64(-ew))) return abs(Float64(Float64(Float64(sin(t) * eh) * sin(t_1)) - Float64(Float64(cos(t) * ew) * cos(t_1)))) end
function tmp = code(eh, ew, t) t_1 = atan(((tan(t) * eh) / -ew)); tmp = abs((((sin(t) * eh) * sin(t_1)) - ((cos(t) * ew) * cos(t_1)))); end
code[eh_, ew_, t_] := Block[{t$95$1 = N[ArcTan[N[(N[(N[Tan[t], $MachinePrecision] * eh), $MachinePrecision] / (-ew)), $MachinePrecision]], $MachinePrecision]}, N[Abs[N[(N[(N[(N[Sin[t], $MachinePrecision] * eh), $MachinePrecision] * N[Sin[t$95$1], $MachinePrecision]), $MachinePrecision] - N[(N[(N[Cos[t], $MachinePrecision] * ew), $MachinePrecision] * N[Cos[t$95$1], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \tan^{-1} \left(\frac{\tan t \cdot eh}{-ew}\right)\\
\left|\left(\sin t \cdot eh\right) \cdot \sin t\_1 - \left(\cos t \cdot ew\right) \cdot \cos t\_1\right|
\end{array}
\end{array}
Initial program 99.8%
Final simplification99.8%
(FPCore (eh ew t) :precision binary64 (let* ((t_1 (atan (* (/ (tan t) ew) eh)))) (fabs (fma (* (sin t) (- eh)) (- (sin t_1)) (* (* (cos t) ew) (cos t_1))))))
double code(double eh, double ew, double t) {
double t_1 = atan(((tan(t) / ew) * eh));
return fabs(fma((sin(t) * -eh), -sin(t_1), ((cos(t) * ew) * cos(t_1))));
}
function code(eh, ew, t) t_1 = atan(Float64(Float64(tan(t) / ew) * eh)) return abs(fma(Float64(sin(t) * Float64(-eh)), Float64(-sin(t_1)), Float64(Float64(cos(t) * ew) * cos(t_1)))) end
code[eh_, ew_, t_] := Block[{t$95$1 = N[ArcTan[N[(N[(N[Tan[t], $MachinePrecision] / ew), $MachinePrecision] * eh), $MachinePrecision]], $MachinePrecision]}, N[Abs[N[(N[(N[Sin[t], $MachinePrecision] * (-eh)), $MachinePrecision] * (-N[Sin[t$95$1], $MachinePrecision]) + N[(N[(N[Cos[t], $MachinePrecision] * ew), $MachinePrecision] * N[Cos[t$95$1], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \tan^{-1} \left(\frac{\tan t}{ew} \cdot eh\right)\\
\left|\mathsf{fma}\left(\sin t \cdot \left(-eh\right), -\sin t\_1, \left(\cos t \cdot ew\right) \cdot \cos t\_1\right)\right|
\end{array}
\end{array}
Initial program 99.8%
Applied rewrites99.8%
Final simplification99.8%
(FPCore (eh ew t) :precision binary64 (fabs (- (* (* (sin t) eh) (sin (atan (/ (* (- eh) t) ew)))) (* (* (cos t) ew) (cos (atan (/ (* (tan t) eh) (- ew))))))))
double code(double eh, double ew, double t) {
return fabs((((sin(t) * eh) * sin(atan(((-eh * t) / ew)))) - ((cos(t) * ew) * cos(atan(((tan(t) * eh) / -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((((sin(t) * eh) * sin(atan(((-eh * t) / ew)))) - ((cos(t) * ew) * cos(atan(((tan(t) * eh) / -ew))))))
end function
public static double code(double eh, double ew, double t) {
return Math.abs((((Math.sin(t) * eh) * Math.sin(Math.atan(((-eh * t) / ew)))) - ((Math.cos(t) * ew) * Math.cos(Math.atan(((Math.tan(t) * eh) / -ew))))));
}
def code(eh, ew, t): return math.fabs((((math.sin(t) * eh) * math.sin(math.atan(((-eh * t) / ew)))) - ((math.cos(t) * ew) * math.cos(math.atan(((math.tan(t) * eh) / -ew))))))
function code(eh, ew, t) return abs(Float64(Float64(Float64(sin(t) * eh) * sin(atan(Float64(Float64(Float64(-eh) * t) / ew)))) - Float64(Float64(cos(t) * ew) * cos(atan(Float64(Float64(tan(t) * eh) / Float64(-ew))))))) end
function tmp = code(eh, ew, t) tmp = abs((((sin(t) * eh) * sin(atan(((-eh * t) / ew)))) - ((cos(t) * ew) * cos(atan(((tan(t) * eh) / -ew)))))); end
code[eh_, ew_, t_] := N[Abs[N[(N[(N[(N[Sin[t], $MachinePrecision] * eh), $MachinePrecision] * N[Sin[N[ArcTan[N[(N[((-eh) * t), $MachinePrecision] / ew), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - N[(N[(N[Cos[t], $MachinePrecision] * ew), $MachinePrecision] * N[Cos[N[ArcTan[N[(N[(N[Tan[t], $MachinePrecision] * eh), $MachinePrecision] / (-ew)), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\left|\left(\sin t \cdot eh\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot t}{ew}\right) - \left(\cos t \cdot ew\right) \cdot \cos \tan^{-1} \left(\frac{\tan t \cdot eh}{-ew}\right)\right|
\end{array}
Initial program 99.8%
Taylor expanded in t around 0
associate-*r*N/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f6499.7
Applied rewrites99.7%
Final simplification99.7%
(FPCore (eh ew t)
:precision binary64
(let* ((t_1 (* (sin t) eh))
(t_2 (fabs (* (sin (atan (* (/ (sin t) ew) (/ eh (cos t))))) t_1))))
(if (<= eh -9e+51)
t_2
(if (<= eh 2.5e+229)
(fabs
(/
(+ (* t_1 (* (/ (tan t) ew) eh)) (* (cos t) ew))
(/ 1.0 (pow (+ 1.0 (pow (/ ew (* (tan t) eh)) -2.0)) -0.5))))
t_2))))
double code(double eh, double ew, double t) {
double t_1 = sin(t) * eh;
double t_2 = fabs((sin(atan(((sin(t) / ew) * (eh / cos(t))))) * t_1));
double tmp;
if (eh <= -9e+51) {
tmp = t_2;
} else if (eh <= 2.5e+229) {
tmp = fabs((((t_1 * ((tan(t) / ew) * eh)) + (cos(t) * ew)) / (1.0 / pow((1.0 + pow((ew / (tan(t) * eh)), -2.0)), -0.5))));
} else {
tmp = t_2;
}
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 = sin(t) * eh
t_2 = abs((sin(atan(((sin(t) / ew) * (eh / cos(t))))) * t_1))
if (eh <= (-9d+51)) then
tmp = t_2
else if (eh <= 2.5d+229) then
tmp = abs((((t_1 * ((tan(t) / ew) * eh)) + (cos(t) * ew)) / (1.0d0 / ((1.0d0 + ((ew / (tan(t) * eh)) ** (-2.0d0))) ** (-0.5d0)))))
else
tmp = t_2
end if
code = tmp
end function
public static double code(double eh, double ew, double t) {
double t_1 = Math.sin(t) * eh;
double t_2 = Math.abs((Math.sin(Math.atan(((Math.sin(t) / ew) * (eh / Math.cos(t))))) * t_1));
double tmp;
if (eh <= -9e+51) {
tmp = t_2;
} else if (eh <= 2.5e+229) {
tmp = Math.abs((((t_1 * ((Math.tan(t) / ew) * eh)) + (Math.cos(t) * ew)) / (1.0 / Math.pow((1.0 + Math.pow((ew / (Math.tan(t) * eh)), -2.0)), -0.5))));
} else {
tmp = t_2;
}
return tmp;
}
def code(eh, ew, t): t_1 = math.sin(t) * eh t_2 = math.fabs((math.sin(math.atan(((math.sin(t) / ew) * (eh / math.cos(t))))) * t_1)) tmp = 0 if eh <= -9e+51: tmp = t_2 elif eh <= 2.5e+229: tmp = math.fabs((((t_1 * ((math.tan(t) / ew) * eh)) + (math.cos(t) * ew)) / (1.0 / math.pow((1.0 + math.pow((ew / (math.tan(t) * eh)), -2.0)), -0.5)))) else: tmp = t_2 return tmp
function code(eh, ew, t) t_1 = Float64(sin(t) * eh) t_2 = abs(Float64(sin(atan(Float64(Float64(sin(t) / ew) * Float64(eh / cos(t))))) * t_1)) tmp = 0.0 if (eh <= -9e+51) tmp = t_2; elseif (eh <= 2.5e+229) tmp = abs(Float64(Float64(Float64(t_1 * Float64(Float64(tan(t) / ew) * eh)) + Float64(cos(t) * ew)) / Float64(1.0 / (Float64(1.0 + (Float64(ew / Float64(tan(t) * eh)) ^ -2.0)) ^ -0.5)))); else tmp = t_2; end return tmp end
function tmp_2 = code(eh, ew, t) t_1 = sin(t) * eh; t_2 = abs((sin(atan(((sin(t) / ew) * (eh / cos(t))))) * t_1)); tmp = 0.0; if (eh <= -9e+51) tmp = t_2; elseif (eh <= 2.5e+229) tmp = abs((((t_1 * ((tan(t) / ew) * eh)) + (cos(t) * ew)) / (1.0 / ((1.0 + ((ew / (tan(t) * eh)) ^ -2.0)) ^ -0.5)))); else tmp = t_2; end tmp_2 = tmp; end
code[eh_, ew_, t_] := Block[{t$95$1 = N[(N[Sin[t], $MachinePrecision] * eh), $MachinePrecision]}, Block[{t$95$2 = N[Abs[N[(N[Sin[N[ArcTan[N[(N[(N[Sin[t], $MachinePrecision] / ew), $MachinePrecision] * N[(eh / N[Cos[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * t$95$1), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[eh, -9e+51], t$95$2, If[LessEqual[eh, 2.5e+229], N[Abs[N[(N[(N[(t$95$1 * N[(N[(N[Tan[t], $MachinePrecision] / ew), $MachinePrecision] * eh), $MachinePrecision]), $MachinePrecision] + N[(N[Cos[t], $MachinePrecision] * ew), $MachinePrecision]), $MachinePrecision] / N[(1.0 / N[Power[N[(1.0 + N[Power[N[(ew / N[(N[Tan[t], $MachinePrecision] * eh), $MachinePrecision]), $MachinePrecision], -2.0], $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], t$95$2]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \sin t \cdot eh\\
t_2 := \left|\sin \tan^{-1} \left(\frac{\sin t}{ew} \cdot \frac{eh}{\cos t}\right) \cdot t\_1\right|\\
\mathbf{if}\;eh \leq -9 \cdot 10^{+51}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;eh \leq 2.5 \cdot 10^{+229}:\\
\;\;\;\;\left|\frac{t\_1 \cdot \left(\frac{\tan t}{ew} \cdot eh\right) + \cos t \cdot ew}{\frac{1}{{\left(1 + {\left(\frac{ew}{\tan t \cdot eh}\right)}^{-2}\right)}^{-0.5}}}\right|\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if eh < -8.9999999999999999e51 or 2.50000000000000025e229 < eh Initial program 99.8%
Applied rewrites99.8%
Taylor expanded in ew around 0
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-sin.f64N/A
lower-sin.f64N/A
lower-atan.f64N/A
*-commutativeN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-cos.f64N/A
lower-/.f64N/A
lower-sin.f6478.7
Applied rewrites78.7%
if -8.9999999999999999e51 < eh < 2.50000000000000025e229Initial program 99.8%
Applied rewrites78.0%
Applied rewrites93.1%
Final simplification88.7%
(FPCore (eh ew t)
:precision binary64
(let* ((t_1
(fabs
(* (sin (atan (* (/ (sin t) ew) (/ eh (cos t))))) (* (sin t) eh))))
(t_2 (* (/ (tan t) ew) eh)))
(if (<= eh -9e+51)
t_1
(if (<= eh 0.22)
(* (fabs (+ (* (* t_2 eh) (sin t)) (* (cos t) ew))) (cos (atan t_2)))
t_1))))
double code(double eh, double ew, double t) {
double t_1 = fabs((sin(atan(((sin(t) / ew) * (eh / cos(t))))) * (sin(t) * eh)));
double t_2 = (tan(t) / ew) * eh;
double tmp;
if (eh <= -9e+51) {
tmp = t_1;
} else if (eh <= 0.22) {
tmp = fabs((((t_2 * eh) * sin(t)) + (cos(t) * ew))) * cos(atan(t_2));
} 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(atan(((sin(t) / ew) * (eh / cos(t))))) * (sin(t) * eh)))
t_2 = (tan(t) / ew) * eh
if (eh <= (-9d+51)) then
tmp = t_1
else if (eh <= 0.22d0) then
tmp = abs((((t_2 * eh) * sin(t)) + (cos(t) * ew))) * cos(atan(t_2))
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(Math.atan(((Math.sin(t) / ew) * (eh / Math.cos(t))))) * (Math.sin(t) * eh)));
double t_2 = (Math.tan(t) / ew) * eh;
double tmp;
if (eh <= -9e+51) {
tmp = t_1;
} else if (eh <= 0.22) {
tmp = Math.abs((((t_2 * eh) * Math.sin(t)) + (Math.cos(t) * ew))) * Math.cos(Math.atan(t_2));
} else {
tmp = t_1;
}
return tmp;
}
def code(eh, ew, t): t_1 = math.fabs((math.sin(math.atan(((math.sin(t) / ew) * (eh / math.cos(t))))) * (math.sin(t) * eh))) t_2 = (math.tan(t) / ew) * eh tmp = 0 if eh <= -9e+51: tmp = t_1 elif eh <= 0.22: tmp = math.fabs((((t_2 * eh) * math.sin(t)) + (math.cos(t) * ew))) * math.cos(math.atan(t_2)) else: tmp = t_1 return tmp
function code(eh, ew, t) t_1 = abs(Float64(sin(atan(Float64(Float64(sin(t) / ew) * Float64(eh / cos(t))))) * Float64(sin(t) * eh))) t_2 = Float64(Float64(tan(t) / ew) * eh) tmp = 0.0 if (eh <= -9e+51) tmp = t_1; elseif (eh <= 0.22) tmp = Float64(abs(Float64(Float64(Float64(t_2 * eh) * sin(t)) + Float64(cos(t) * ew))) * cos(atan(t_2))); else tmp = t_1; end return tmp end
function tmp_2 = code(eh, ew, t) t_1 = abs((sin(atan(((sin(t) / ew) * (eh / cos(t))))) * (sin(t) * eh))); t_2 = (tan(t) / ew) * eh; tmp = 0.0; if (eh <= -9e+51) tmp = t_1; elseif (eh <= 0.22) tmp = abs((((t_2 * eh) * sin(t)) + (cos(t) * ew))) * cos(atan(t_2)); else tmp = t_1; end tmp_2 = tmp; end
code[eh_, ew_, t_] := Block[{t$95$1 = N[Abs[N[(N[Sin[N[ArcTan[N[(N[(N[Sin[t], $MachinePrecision] / ew), $MachinePrecision] * N[(eh / N[Cos[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * N[(N[Sin[t], $MachinePrecision] * eh), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[Tan[t], $MachinePrecision] / ew), $MachinePrecision] * eh), $MachinePrecision]}, If[LessEqual[eh, -9e+51], t$95$1, If[LessEqual[eh, 0.22], N[(N[Abs[N[(N[(N[(t$95$2 * eh), $MachinePrecision] * N[Sin[t], $MachinePrecision]), $MachinePrecision] + N[(N[Cos[t], $MachinePrecision] * ew), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Cos[N[ArcTan[t$95$2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left|\sin \tan^{-1} \left(\frac{\sin t}{ew} \cdot \frac{eh}{\cos t}\right) \cdot \left(\sin t \cdot eh\right)\right|\\
t_2 := \frac{\tan t}{ew} \cdot eh\\
\mathbf{if}\;eh \leq -9 \cdot 10^{+51}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;eh \leq 0.22:\\
\;\;\;\;\left|\left(t\_2 \cdot eh\right) \cdot \sin t + \cos t \cdot ew\right| \cdot \cos \tan^{-1} t\_2\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if eh < -8.9999999999999999e51 or 0.220000000000000001 < eh Initial program 99.8%
Applied rewrites99.8%
Taylor expanded in ew around 0
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-sin.f64N/A
lower-sin.f64N/A
lower-atan.f64N/A
*-commutativeN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-cos.f64N/A
lower-/.f64N/A
lower-sin.f6471.8
Applied rewrites71.8%
if -8.9999999999999999e51 < eh < 0.220000000000000001Initial program 99.9%
Applied rewrites99.8%
Applied rewrites87.5%
Final simplification80.1%
(FPCore (eh ew t)
:precision binary64
(let* ((t_1 (/ eh (cos t)))
(t_2 (fabs (* (sin (atan (* (/ (sin t) ew) t_1))) (* (sin t) eh)))))
(if (<= eh -9e+51)
t_2
(if (<= eh 0.22)
(fabs (* (cos (atan (* (/ (- (sin t)) ew) t_1))) (* (cos t) ew)))
t_2))))
double code(double eh, double ew, double t) {
double t_1 = eh / cos(t);
double t_2 = fabs((sin(atan(((sin(t) / ew) * t_1))) * (sin(t) * eh)));
double tmp;
if (eh <= -9e+51) {
tmp = t_2;
} else if (eh <= 0.22) {
tmp = fabs((cos(atan(((-sin(t) / ew) * t_1))) * (cos(t) * ew)));
} else {
tmp = t_2;
}
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 = eh / cos(t)
t_2 = abs((sin(atan(((sin(t) / ew) * t_1))) * (sin(t) * eh)))
if (eh <= (-9d+51)) then
tmp = t_2
else if (eh <= 0.22d0) then
tmp = abs((cos(atan(((-sin(t) / ew) * t_1))) * (cos(t) * ew)))
else
tmp = t_2
end if
code = tmp
end function
public static double code(double eh, double ew, double t) {
double t_1 = eh / Math.cos(t);
double t_2 = Math.abs((Math.sin(Math.atan(((Math.sin(t) / ew) * t_1))) * (Math.sin(t) * eh)));
double tmp;
if (eh <= -9e+51) {
tmp = t_2;
} else if (eh <= 0.22) {
tmp = Math.abs((Math.cos(Math.atan(((-Math.sin(t) / ew) * t_1))) * (Math.cos(t) * ew)));
} else {
tmp = t_2;
}
return tmp;
}
def code(eh, ew, t): t_1 = eh / math.cos(t) t_2 = math.fabs((math.sin(math.atan(((math.sin(t) / ew) * t_1))) * (math.sin(t) * eh))) tmp = 0 if eh <= -9e+51: tmp = t_2 elif eh <= 0.22: tmp = math.fabs((math.cos(math.atan(((-math.sin(t) / ew) * t_1))) * (math.cos(t) * ew))) else: tmp = t_2 return tmp
function code(eh, ew, t) t_1 = Float64(eh / cos(t)) t_2 = abs(Float64(sin(atan(Float64(Float64(sin(t) / ew) * t_1))) * Float64(sin(t) * eh))) tmp = 0.0 if (eh <= -9e+51) tmp = t_2; elseif (eh <= 0.22) tmp = abs(Float64(cos(atan(Float64(Float64(Float64(-sin(t)) / ew) * t_1))) * Float64(cos(t) * ew))); else tmp = t_2; end return tmp end
function tmp_2 = code(eh, ew, t) t_1 = eh / cos(t); t_2 = abs((sin(atan(((sin(t) / ew) * t_1))) * (sin(t) * eh))); tmp = 0.0; if (eh <= -9e+51) tmp = t_2; elseif (eh <= 0.22) tmp = abs((cos(atan(((-sin(t) / ew) * t_1))) * (cos(t) * ew))); else tmp = t_2; end tmp_2 = tmp; end
code[eh_, ew_, t_] := Block[{t$95$1 = N[(eh / N[Cos[t], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Abs[N[(N[Sin[N[ArcTan[N[(N[(N[Sin[t], $MachinePrecision] / ew), $MachinePrecision] * t$95$1), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * N[(N[Sin[t], $MachinePrecision] * eh), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[eh, -9e+51], t$95$2, If[LessEqual[eh, 0.22], N[Abs[N[(N[Cos[N[ArcTan[N[(N[((-N[Sin[t], $MachinePrecision]) / ew), $MachinePrecision] * t$95$1), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * N[(N[Cos[t], $MachinePrecision] * ew), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], t$95$2]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{eh}{\cos t}\\
t_2 := \left|\sin \tan^{-1} \left(\frac{\sin t}{ew} \cdot t\_1\right) \cdot \left(\sin t \cdot eh\right)\right|\\
\mathbf{if}\;eh \leq -9 \cdot 10^{+51}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;eh \leq 0.22:\\
\;\;\;\;\left|\cos \tan^{-1} \left(\frac{-\sin t}{ew} \cdot t\_1\right) \cdot \left(\cos t \cdot ew\right)\right|\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if eh < -8.9999999999999999e51 or 0.220000000000000001 < eh Initial program 99.8%
Applied rewrites99.8%
Taylor expanded in ew around 0
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-sin.f64N/A
lower-sin.f64N/A
lower-atan.f64N/A
*-commutativeN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-cos.f64N/A
lower-/.f64N/A
lower-sin.f6471.8
Applied rewrites71.8%
if -8.9999999999999999e51 < eh < 0.220000000000000001Initial program 99.9%
Taylor expanded in ew around inf
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites85.9%
Final simplification79.2%
(FPCore (eh ew t)
:precision binary64
(let* ((t_1
(fabs
(* (sin (atan (* (/ (sin t) ew) (/ eh (cos t))))) (* (sin t) eh)))))
(if (<= eh -9e+51)
t_1
(if (<= eh 0.22)
(fabs
(/ (* (- (cos t)) ew) (/ -1.0 (cos (atan (* (/ (tan t) ew) eh))))))
t_1))))
double code(double eh, double ew, double t) {
double t_1 = fabs((sin(atan(((sin(t) / ew) * (eh / cos(t))))) * (sin(t) * eh)));
double tmp;
if (eh <= -9e+51) {
tmp = t_1;
} else if (eh <= 0.22) {
tmp = fabs(((-cos(t) * ew) / (-1.0 / cos(atan(((tan(t) / ew) * 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((sin(atan(((sin(t) / ew) * (eh / cos(t))))) * (sin(t) * eh)))
if (eh <= (-9d+51)) then
tmp = t_1
else if (eh <= 0.22d0) then
tmp = abs(((-cos(t) * ew) / ((-1.0d0) / cos(atan(((tan(t) / ew) * 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((Math.sin(Math.atan(((Math.sin(t) / ew) * (eh / Math.cos(t))))) * (Math.sin(t) * eh)));
double tmp;
if (eh <= -9e+51) {
tmp = t_1;
} else if (eh <= 0.22) {
tmp = Math.abs(((-Math.cos(t) * ew) / (-1.0 / Math.cos(Math.atan(((Math.tan(t) / ew) * eh))))));
} else {
tmp = t_1;
}
return tmp;
}
def code(eh, ew, t): t_1 = math.fabs((math.sin(math.atan(((math.sin(t) / ew) * (eh / math.cos(t))))) * (math.sin(t) * eh))) tmp = 0 if eh <= -9e+51: tmp = t_1 elif eh <= 0.22: tmp = math.fabs(((-math.cos(t) * ew) / (-1.0 / math.cos(math.atan(((math.tan(t) / ew) * eh)))))) else: tmp = t_1 return tmp
function code(eh, ew, t) t_1 = abs(Float64(sin(atan(Float64(Float64(sin(t) / ew) * Float64(eh / cos(t))))) * Float64(sin(t) * eh))) tmp = 0.0 if (eh <= -9e+51) tmp = t_1; elseif (eh <= 0.22) tmp = abs(Float64(Float64(Float64(-cos(t)) * ew) / Float64(-1.0 / cos(atan(Float64(Float64(tan(t) / ew) * eh)))))); else tmp = t_1; end return tmp end
function tmp_2 = code(eh, ew, t) t_1 = abs((sin(atan(((sin(t) / ew) * (eh / cos(t))))) * (sin(t) * eh))); tmp = 0.0; if (eh <= -9e+51) tmp = t_1; elseif (eh <= 0.22) tmp = abs(((-cos(t) * ew) / (-1.0 / cos(atan(((tan(t) / ew) * eh)))))); else tmp = t_1; end tmp_2 = tmp; end
code[eh_, ew_, t_] := Block[{t$95$1 = N[Abs[N[(N[Sin[N[ArcTan[N[(N[(N[Sin[t], $MachinePrecision] / ew), $MachinePrecision] * N[(eh / N[Cos[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * N[(N[Sin[t], $MachinePrecision] * eh), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[eh, -9e+51], t$95$1, If[LessEqual[eh, 0.22], N[Abs[N[(N[((-N[Cos[t], $MachinePrecision]) * ew), $MachinePrecision] / N[(-1.0 / N[Cos[N[ArcTan[N[(N[(N[Tan[t], $MachinePrecision] / ew), $MachinePrecision] * eh), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left|\sin \tan^{-1} \left(\frac{\sin t}{ew} \cdot \frac{eh}{\cos t}\right) \cdot \left(\sin t \cdot eh\right)\right|\\
\mathbf{if}\;eh \leq -9 \cdot 10^{+51}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;eh \leq 0.22:\\
\;\;\;\;\left|\frac{\left(-\cos t\right) \cdot ew}{\frac{-1}{\cos \tan^{-1} \left(\frac{\tan t}{ew} \cdot eh\right)}}\right|\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if eh < -8.9999999999999999e51 or 0.220000000000000001 < eh Initial program 99.8%
Applied rewrites99.8%
Taylor expanded in ew around 0
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-sin.f64N/A
lower-sin.f64N/A
lower-atan.f64N/A
*-commutativeN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-cos.f64N/A
lower-/.f64N/A
lower-sin.f6471.8
Applied rewrites71.8%
if -8.9999999999999999e51 < eh < 0.220000000000000001Initial program 99.9%
Applied rewrites87.5%
Taylor expanded in ew around inf
associate-*r*N/A
mul-1-negN/A
lower-*.f64N/A
lower-neg.f64N/A
lower-cos.f6485.9
Applied rewrites85.9%
Final simplification79.2%
(FPCore (eh ew t)
:precision binary64
(let* ((t_1 (atan (* (/ (tan t) ew) eh)))
(t_2 (fabs (* (/ (* (sin t_1) (* (sin t) eh)) ew) ew))))
(if (<= eh -9e+51)
t_2
(if (<= eh 0.22) (fabs (/ (* (- (cos t)) ew) (/ -1.0 (cos t_1)))) t_2))))
double code(double eh, double ew, double t) {
double t_1 = atan(((tan(t) / ew) * eh));
double t_2 = fabs((((sin(t_1) * (sin(t) * eh)) / ew) * ew));
double tmp;
if (eh <= -9e+51) {
tmp = t_2;
} else if (eh <= 0.22) {
tmp = fabs(((-cos(t) * ew) / (-1.0 / cos(t_1))));
} else {
tmp = t_2;
}
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 = atan(((tan(t) / ew) * eh))
t_2 = abs((((sin(t_1) * (sin(t) * eh)) / ew) * ew))
if (eh <= (-9d+51)) then
tmp = t_2
else if (eh <= 0.22d0) then
tmp = abs(((-cos(t) * ew) / ((-1.0d0) / cos(t_1))))
else
tmp = t_2
end if
code = tmp
end function
public static double code(double eh, double ew, double t) {
double t_1 = Math.atan(((Math.tan(t) / ew) * eh));
double t_2 = Math.abs((((Math.sin(t_1) * (Math.sin(t) * eh)) / ew) * ew));
double tmp;
if (eh <= -9e+51) {
tmp = t_2;
} else if (eh <= 0.22) {
tmp = Math.abs(((-Math.cos(t) * ew) / (-1.0 / Math.cos(t_1))));
} else {
tmp = t_2;
}
return tmp;
}
def code(eh, ew, t): t_1 = math.atan(((math.tan(t) / ew) * eh)) t_2 = math.fabs((((math.sin(t_1) * (math.sin(t) * eh)) / ew) * ew)) tmp = 0 if eh <= -9e+51: tmp = t_2 elif eh <= 0.22: tmp = math.fabs(((-math.cos(t) * ew) / (-1.0 / math.cos(t_1)))) else: tmp = t_2 return tmp
function code(eh, ew, t) t_1 = atan(Float64(Float64(tan(t) / ew) * eh)) t_2 = abs(Float64(Float64(Float64(sin(t_1) * Float64(sin(t) * eh)) / ew) * ew)) tmp = 0.0 if (eh <= -9e+51) tmp = t_2; elseif (eh <= 0.22) tmp = abs(Float64(Float64(Float64(-cos(t)) * ew) / Float64(-1.0 / cos(t_1)))); else tmp = t_2; end return tmp end
function tmp_2 = code(eh, ew, t) t_1 = atan(((tan(t) / ew) * eh)); t_2 = abs((((sin(t_1) * (sin(t) * eh)) / ew) * ew)); tmp = 0.0; if (eh <= -9e+51) tmp = t_2; elseif (eh <= 0.22) tmp = abs(((-cos(t) * ew) / (-1.0 / cos(t_1)))); else tmp = t_2; end tmp_2 = tmp; end
code[eh_, ew_, t_] := Block[{t$95$1 = N[ArcTan[N[(N[(N[Tan[t], $MachinePrecision] / ew), $MachinePrecision] * eh), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Abs[N[(N[(N[(N[Sin[t$95$1], $MachinePrecision] * N[(N[Sin[t], $MachinePrecision] * eh), $MachinePrecision]), $MachinePrecision] / ew), $MachinePrecision] * ew), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[eh, -9e+51], t$95$2, If[LessEqual[eh, 0.22], N[Abs[N[(N[((-N[Cos[t], $MachinePrecision]) * ew), $MachinePrecision] / N[(-1.0 / N[Cos[t$95$1], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], t$95$2]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \tan^{-1} \left(\frac{\tan t}{ew} \cdot eh\right)\\
t_2 := \left|\frac{\sin t\_1 \cdot \left(\sin t \cdot eh\right)}{ew} \cdot ew\right|\\
\mathbf{if}\;eh \leq -9 \cdot 10^{+51}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;eh \leq 0.22:\\
\;\;\;\;\left|\frac{\left(-\cos t\right) \cdot ew}{\frac{-1}{\cos t\_1}}\right|\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if eh < -8.9999999999999999e51 or 0.220000000000000001 < eh Initial program 99.8%
Applied rewrites99.8%
Taylor expanded in ew around inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites86.6%
Taylor expanded in ew around 0
Applied rewrites58.4%
Applied rewrites58.6%
if -8.9999999999999999e51 < eh < 0.220000000000000001Initial program 99.9%
Applied rewrites87.5%
Taylor expanded in ew around inf
associate-*r*N/A
mul-1-negN/A
lower-*.f64N/A
lower-neg.f64N/A
lower-cos.f6485.9
Applied rewrites85.9%
Final simplification73.0%
(FPCore (eh ew t)
:precision binary64
(let* ((t_1
(fabs
(*
(/ (* (sin (atan (* (/ (tan t) ew) eh))) (* (sin t) eh)) ew)
ew))))
(if (<= eh -1.65e+49)
t_1
(if (<= eh 0.195)
(fabs (* (* (- (cos t)) ew) (cos (atan (* (/ t ew) eh)))))
t_1))))
double code(double eh, double ew, double t) {
double t_1 = fabs((((sin(atan(((tan(t) / ew) * eh))) * (sin(t) * eh)) / ew) * ew));
double tmp;
if (eh <= -1.65e+49) {
tmp = t_1;
} else if (eh <= 0.195) {
tmp = fabs(((-cos(t) * ew) * cos(atan(((t / ew) * 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((((sin(atan(((tan(t) / ew) * eh))) * (sin(t) * eh)) / ew) * ew))
if (eh <= (-1.65d+49)) then
tmp = t_1
else if (eh <= 0.195d0) then
tmp = abs(((-cos(t) * ew) * cos(atan(((t / ew) * 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((((Math.sin(Math.atan(((Math.tan(t) / ew) * eh))) * (Math.sin(t) * eh)) / ew) * ew));
double tmp;
if (eh <= -1.65e+49) {
tmp = t_1;
} else if (eh <= 0.195) {
tmp = Math.abs(((-Math.cos(t) * ew) * Math.cos(Math.atan(((t / ew) * eh)))));
} else {
tmp = t_1;
}
return tmp;
}
def code(eh, ew, t): t_1 = math.fabs((((math.sin(math.atan(((math.tan(t) / ew) * eh))) * (math.sin(t) * eh)) / ew) * ew)) tmp = 0 if eh <= -1.65e+49: tmp = t_1 elif eh <= 0.195: tmp = math.fabs(((-math.cos(t) * ew) * math.cos(math.atan(((t / ew) * eh))))) else: tmp = t_1 return tmp
function code(eh, ew, t) t_1 = abs(Float64(Float64(Float64(sin(atan(Float64(Float64(tan(t) / ew) * eh))) * Float64(sin(t) * eh)) / ew) * ew)) tmp = 0.0 if (eh <= -1.65e+49) tmp = t_1; elseif (eh <= 0.195) tmp = abs(Float64(Float64(Float64(-cos(t)) * ew) * cos(atan(Float64(Float64(t / ew) * eh))))); else tmp = t_1; end return tmp end
function tmp_2 = code(eh, ew, t) t_1 = abs((((sin(atan(((tan(t) / ew) * eh))) * (sin(t) * eh)) / ew) * ew)); tmp = 0.0; if (eh <= -1.65e+49) tmp = t_1; elseif (eh <= 0.195) tmp = abs(((-cos(t) * ew) * cos(atan(((t / ew) * eh))))); else tmp = t_1; end tmp_2 = tmp; end
code[eh_, ew_, t_] := Block[{t$95$1 = N[Abs[N[(N[(N[(N[Sin[N[ArcTan[N[(N[(N[Tan[t], $MachinePrecision] / ew), $MachinePrecision] * eh), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * N[(N[Sin[t], $MachinePrecision] * eh), $MachinePrecision]), $MachinePrecision] / ew), $MachinePrecision] * ew), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[eh, -1.65e+49], t$95$1, If[LessEqual[eh, 0.195], N[Abs[N[(N[((-N[Cos[t], $MachinePrecision]) * ew), $MachinePrecision] * N[Cos[N[ArcTan[N[(N[(t / ew), $MachinePrecision] * eh), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left|\frac{\sin \tan^{-1} \left(\frac{\tan t}{ew} \cdot eh\right) \cdot \left(\sin t \cdot eh\right)}{ew} \cdot ew\right|\\
\mathbf{if}\;eh \leq -1.65 \cdot 10^{+49}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;eh \leq 0.195:\\
\;\;\;\;\left|\left(\left(-\cos t\right) \cdot ew\right) \cdot \cos \tan^{-1} \left(\frac{t}{ew} \cdot eh\right)\right|\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if eh < -1.6499999999999999e49 or 0.19500000000000001 < eh Initial program 99.8%
Applied rewrites99.8%
Taylor expanded in ew around inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites86.6%
Taylor expanded in ew around 0
Applied rewrites58.4%
Applied rewrites58.6%
if -1.6499999999999999e49 < eh < 0.19500000000000001Initial program 99.9%
Applied rewrites87.5%
Taylor expanded in t around 0
lower-/.f6479.4
Applied rewrites79.4%
Taylor expanded in ew around inf
associate-*r*N/A
mul-1-negN/A
lower-*.f64N/A
lower-neg.f64N/A
lower-cos.f6477.8
Applied rewrites77.8%
lift-/.f64N/A
lift-/.f64N/A
associate-/r/N/A
/-rgt-identityN/A
*-commutativeN/A
lower-*.f6477.8
Applied rewrites77.8%
Final simplification68.7%
(FPCore (eh ew t)
:precision binary64
(let* ((t_1
(fabs (* (* (/ (sin (atan (/ (* eh t) ew))) ew) (* (sin t) eh)) ew))))
(if (<= eh -1.65e+49)
t_1
(if (<= eh 0.195)
(fabs (* (* (- (cos t)) ew) (cos (atan (* (/ t ew) eh)))))
t_1))))
double code(double eh, double ew, double t) {
double t_1 = fabs((((sin(atan(((eh * t) / ew))) / ew) * (sin(t) * eh)) * ew));
double tmp;
if (eh <= -1.65e+49) {
tmp = t_1;
} else if (eh <= 0.195) {
tmp = fabs(((-cos(t) * ew) * cos(atan(((t / ew) * 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((((sin(atan(((eh * t) / ew))) / ew) * (sin(t) * eh)) * ew))
if (eh <= (-1.65d+49)) then
tmp = t_1
else if (eh <= 0.195d0) then
tmp = abs(((-cos(t) * ew) * cos(atan(((t / ew) * 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((((Math.sin(Math.atan(((eh * t) / ew))) / ew) * (Math.sin(t) * eh)) * ew));
double tmp;
if (eh <= -1.65e+49) {
tmp = t_1;
} else if (eh <= 0.195) {
tmp = Math.abs(((-Math.cos(t) * ew) * Math.cos(Math.atan(((t / ew) * eh)))));
} else {
tmp = t_1;
}
return tmp;
}
def code(eh, ew, t): t_1 = math.fabs((((math.sin(math.atan(((eh * t) / ew))) / ew) * (math.sin(t) * eh)) * ew)) tmp = 0 if eh <= -1.65e+49: tmp = t_1 elif eh <= 0.195: tmp = math.fabs(((-math.cos(t) * ew) * math.cos(math.atan(((t / ew) * eh))))) else: tmp = t_1 return tmp
function code(eh, ew, t) t_1 = abs(Float64(Float64(Float64(sin(atan(Float64(Float64(eh * t) / ew))) / ew) * Float64(sin(t) * eh)) * ew)) tmp = 0.0 if (eh <= -1.65e+49) tmp = t_1; elseif (eh <= 0.195) tmp = abs(Float64(Float64(Float64(-cos(t)) * ew) * cos(atan(Float64(Float64(t / ew) * eh))))); else tmp = t_1; end return tmp end
function tmp_2 = code(eh, ew, t) t_1 = abs((((sin(atan(((eh * t) / ew))) / ew) * (sin(t) * eh)) * ew)); tmp = 0.0; if (eh <= -1.65e+49) tmp = t_1; elseif (eh <= 0.195) tmp = abs(((-cos(t) * ew) * cos(atan(((t / ew) * eh))))); else tmp = t_1; end tmp_2 = tmp; end
code[eh_, ew_, t_] := Block[{t$95$1 = N[Abs[N[(N[(N[(N[Sin[N[ArcTan[N[(N[(eh * t), $MachinePrecision] / ew), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] / ew), $MachinePrecision] * N[(N[Sin[t], $MachinePrecision] * eh), $MachinePrecision]), $MachinePrecision] * ew), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[eh, -1.65e+49], t$95$1, If[LessEqual[eh, 0.195], N[Abs[N[(N[((-N[Cos[t], $MachinePrecision]) * ew), $MachinePrecision] * N[Cos[N[ArcTan[N[(N[(t / ew), $MachinePrecision] * eh), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left|\left(\frac{\sin \tan^{-1} \left(\frac{eh \cdot t}{ew}\right)}{ew} \cdot \left(\sin t \cdot eh\right)\right) \cdot ew\right|\\
\mathbf{if}\;eh \leq -1.65 \cdot 10^{+49}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;eh \leq 0.195:\\
\;\;\;\;\left|\left(\left(-\cos t\right) \cdot ew\right) \cdot \cos \tan^{-1} \left(\frac{t}{ew} \cdot eh\right)\right|\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if eh < -1.6499999999999999e49 or 0.19500000000000001 < eh Initial program 99.8%
Applied rewrites99.8%
Taylor expanded in ew around inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites86.6%
Taylor expanded in ew around 0
Applied rewrites58.4%
Taylor expanded in t around 0
Applied rewrites58.5%
if -1.6499999999999999e49 < eh < 0.19500000000000001Initial program 99.9%
Applied rewrites87.5%
Taylor expanded in t around 0
lower-/.f6479.4
Applied rewrites79.4%
Taylor expanded in ew around inf
associate-*r*N/A
mul-1-negN/A
lower-*.f64N/A
lower-neg.f64N/A
lower-cos.f6477.8
Applied rewrites77.8%
lift-/.f64N/A
lift-/.f64N/A
associate-/r/N/A
/-rgt-identityN/A
*-commutativeN/A
lower-*.f6477.8
Applied rewrites77.8%
Final simplification68.7%
(FPCore (eh ew t) :precision binary64 (fabs (* (* (- (cos t)) ew) (cos (atan (* (/ t ew) eh))))))
double code(double eh, double ew, double t) {
return fabs(((-cos(t) * ew) * cos(atan(((t / ew) * 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(((-cos(t) * ew) * cos(atan(((t / ew) * eh)))))
end function
public static double code(double eh, double ew, double t) {
return Math.abs(((-Math.cos(t) * ew) * Math.cos(Math.atan(((t / ew) * eh)))));
}
def code(eh, ew, t): return math.fabs(((-math.cos(t) * ew) * math.cos(math.atan(((t / ew) * eh)))))
function code(eh, ew, t) return abs(Float64(Float64(Float64(-cos(t)) * ew) * cos(atan(Float64(Float64(t / ew) * eh))))) end
function tmp = code(eh, ew, t) tmp = abs(((-cos(t) * ew) * cos(atan(((t / ew) * eh))))); end
code[eh_, ew_, t_] := N[Abs[N[(N[((-N[Cos[t], $MachinePrecision]) * ew), $MachinePrecision] * N[Cos[N[ArcTan[N[(N[(t / ew), $MachinePrecision] * eh), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\left|\left(\left(-\cos t\right) \cdot ew\right) \cdot \cos \tan^{-1} \left(\frac{t}{ew} \cdot eh\right)\right|
\end{array}
Initial program 99.8%
Applied rewrites63.0%
Taylor expanded in t around 0
lower-/.f6456.0
Applied rewrites56.0%
Taylor expanded in ew around inf
associate-*r*N/A
mul-1-negN/A
lower-*.f64N/A
lower-neg.f64N/A
lower-cos.f6453.9
Applied rewrites53.9%
lift-/.f64N/A
lift-/.f64N/A
associate-/r/N/A
/-rgt-identityN/A
*-commutativeN/A
lower-*.f6453.9
Applied rewrites53.9%
Final simplification53.9%
(FPCore (eh ew t) :precision binary64 (fabs (/ ew 1.0)))
double code(double eh, double ew, double t) {
return fabs((ew / 1.0));
}
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 / 1.0d0))
end function
public static double code(double eh, double ew, double t) {
return Math.abs((ew / 1.0));
}
def code(eh, ew, t): return math.fabs((ew / 1.0))
function code(eh, ew, t) return abs(Float64(ew / 1.0)) end
function tmp = code(eh, ew, t) tmp = abs((ew / 1.0)); end
code[eh_, ew_, t_] := N[Abs[N[(ew / 1.0), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\left|\frac{ew}{1}\right|
\end{array}
Initial program 99.8%
Taylor expanded in t around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites43.2%
Taylor expanded in t around 0
Applied rewrites42.5%
Applied rewrites41.7%
Taylor expanded in ew around inf
Applied rewrites43.4%
herbie shell --seed 2024255
(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)))))))